case1
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a04cf6ca22a95684e9283ab039f68c66
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cinemachine.Examples
|
||||
{
|
||||
public class ActivateOnKeypress : MonoBehaviour
|
||||
{
|
||||
public KeyCode ActivationKey = KeyCode.LeftControl;
|
||||
public int PriorityBoostAmount = 10;
|
||||
public GameObject Reticle;
|
||||
|
||||
Cinemachine.CinemachineVirtualCameraBase vcam;
|
||||
bool boosted = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
vcam = GetComponent<Cinemachine.CinemachineVirtualCameraBase>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
#if ENABLE_LEGACY_INPUT_MANAGER
|
||||
if (vcam != null)
|
||||
{
|
||||
if (Input.GetKey(ActivationKey))
|
||||
{
|
||||
if (!boosted)
|
||||
{
|
||||
vcam.Priority += PriorityBoostAmount;
|
||||
boosted = true;
|
||||
}
|
||||
}
|
||||
else if (boosted)
|
||||
{
|
||||
vcam.Priority -= PriorityBoostAmount;
|
||||
boosted = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (Reticle != null)
|
||||
Reticle.SetActive(boosted);
|
||||
#else
|
||||
InputSystemHelper.EnableBackendsWarningMessage();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8fce4bd108661c4d9740aea3bc971ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user