Beispiel #1
0
 private void debugInput()
 {
     if (Input.GetKeyDown(KeyCode.Backspace))
     {
         stats.resources += 1000;
         hud.updateResourceText();
     }
     if (Input.GetKeyDown(KeyCode.Q))
     {
         pickupKeyDown = true;                                           //pickup key pressed
     }
     if (Input.GetKeyUp(KeyCode.Q))
     {
         pickupKeyDown = false;                                              //pickup key released
     }
     if (Input.GetKeyDown(KeyCode.E))
     {
         resKeyDown = true;                                                          //scrap for cash key down
     }
     if (Input.GetKeyUp(KeyCode.E))
     {
         resKeyDown = false;                                                         //scrap for cash key released
     }
     if (Input.GetKeyDown(KeyCode.U))
     {
         if (stats.resources > 100)
         {
             stats.resources -= 100;
             hud.updateResourceText();
             cSlice.shoot(projectile, this.gameObject.transform.position, this.gameObject.transform.forward, this.gameObject.transform.rotation, true);                      //shoot something
         }
         else
         {
             Debug.Log("100 resources needed to shoot");
         }
     }
 }
Beispiel #2
0
    void Update()
    {
        if (active)
        {
            if (deathTime < Time.time)
            {
                Destroy(gameObject);                                                                            //goodbye cruel world
            }
            thrusters.transform.Rotate(new Vector3(0, 200, 0) * Time.deltaTime);                                //rotate the thrusters

            if (target != null)
            {
                transform.LookAt(target.transform.position);
                cSlice.shoot(projectile, this.gameObject.transform.position, this.gameObject.transform.forward, this.gameObject.transform.rotation, true);
            }
        }
    }
Beispiel #3
0
 void firingState()
 {
     //Initialize the state if I'm just now entering.
     if (currentState != TurretState.FIRING)
     {
         framesInState = 0;
         timeInState   = 0.0f;
         if (debugMode)
         {
             Debug.Log("Entered firing State");
         }
         currentState = TurretState.FIRING;
         return;
     }
     else
     {
         cSlice.shoot(projectile, barrel.gameObject.transform.position, barrel.gameObject.transform.forward, barrel.gameObject.transform.rotation, false);
         coolingState();
         return;
     }
 }