Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (canControl)
     {
         skillTimer -= skillTimeLim;
         if (Input.GetButtonDown("Fire1") && skillTimer <= 0 && canUseSkill == true)
         {
             print("release skill");
             GameObject.Instantiate(prefab, transform.position, Quaternion.identity);
             skillTimer = skillTimeLim;
         }
         else
         {
             //print ("skill time limit");
         }
         controller.SimpleMove(new Vector3(speed * Input.GetAxis("Horizontal"),
                                           0,
                                           speed * Input.GetAxis("Vertical")));
     }
     // change camera
     if (onTrex && Input.GetKeyDown(KeyCode.Q))
     {
         if (canControl)
         {
             trex.GetControl();
             this.LoseControl();
         }
         else
         {
             trex.LoseControl();
             this.GetControl();
         }
     }
 }