// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (Input.GetKeyDown(KeyCode.F)) { Debug.Log("Tiro fuori l'arma"); GameManagerPistol.WeaponPistolOn(); } }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (!Input.GetKey(KeyCode.R) && Input.GetKey(KeyCode.Space)) { GameManagerPistol.ShotBullet(); } else if (!Input.GetKey(KeyCode.R) & !Input.GetKey(KeyCode.Space)) { GameManagerPistol.WeaponPistolOn(); } }
private void Awake() { if (singleton == null) { singleton = this; DontDestroyOnLoad(singleton); } else { DestroyImmediate(singleton); } Setup(); }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (Input.GetMouseButton(1)) { Debug.Log("Sto sparando"); GameManagerPistol.FocusPistol(); } else if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("Ho finito i colpi, devo ricaricare"); GameManagerPistol.ReloadPistol(); } else { GameManagerPistol.WeaponPistolOn(); } }
// OnStateUpdate is called before OnStateUpdate is called on any state inside this state machine override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (Input.GetMouseButton(1)) { Debug.Log("Ti ho nel mirino"); if (Input.GetKey(KeyCode.Space)) { Debug.Log("Ti sparo"); GameManagerPistol.ShotBullet(); } } else if (!Input.GetMouseButton(1) && Input.GetKey(KeyCode.Space)) { GameManagerPistol.ShotBullet(); } else if (!Input.GetMouseButton(1) & !Input.GetKey(KeyCode.Space)) { GameManagerPistol.WeaponPistolOn(); } }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (Input.GetKeyDown(KeyCode.Space)) { Debug.Log("Sto per sparare"); GameManagerPistol.ShotBullet(); } else if (Input.GetKeyDown(KeyCode.R)) { Debug.Log("Devo ricaricare"); GameManagerPistol.ReloadPistol(); } else if (Input.GetKeyDown(KeyCode.F)) { Debug.Log("Metto via l'arma"); GameManagerPistol.WeaponPistolOff(); } else if (Input.GetMouseButton(1)) { Debug.Log("Ti miro"); GameManagerPistol.FocusPistol(); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { GameManagerPistol.Setup(); GameManagerPistol.EventSetup(); }