示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;
     controller       = GetComponent <CharacterController>();
     animator         = GetComponent <Animator>();
     stop             = false;
     if (Instance == null)
     {
         Instance = this;
     }
     turn.x     = transform.rotation.eulerAngles.y;
     turn.y     = 0f;
     maxStamina = (int)InterfaceController.Instance.max_stamina;
     stamina    = (int)InterfaceController.Instance.stamina;
     // ui = GameObject.Find("InterfaceCanvas").GetComponent<InterfaceController>();
     // stamina = 100f;
     // ui.SetStamina(1f);
     shoulder = transform.GetChild(3).gameObject;
     if (InterfaceController.Instance.start_menu.active) //at the start of the game
     {
         ResumeMouseControl();                           //open mouse control
     }
 }
示例#2
0
 // 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)
 {
     player = GameObject.Find("Vanguard").GetComponent <ThridPersonController>();
     player.attackLock(new Vector3(0, 0, 0), 1);
 }
示例#3
0
 // 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)
 {
     player = GameObject.Find("Vanguard").GetComponent <ThridPersonController>();
     player.airLock();
     Debug.Log("unlock air from animtor");
 }