// Update is called once per frame
 void Update()
 {
     DestroyCount     += Time.deltaTime;
     pmc.rotationSpeed = 1; //MARK: temporary slow player;
     pmc.walkSpeed     = 2;
     CF.SetSensitivity(60);
     CMC.MoveToAimingLocation(false);
     //bool leftInput = Input.GetAxisRaw("Mouse X") > 0; // gets right
     //bool rightInput = Input.GetAxisRaw("Mouse Y") < 0; // gets left
     pmc.Aiming = true;
     if (DestroyCount > DestroyTime)
     {
         pmc.CanMove = true;
         pmc.Aiming  = false;
         CF.RestoreSensitivity();
         CMC.ReturnFromAimingLocation();
         pmc.rotationSpeed = 60;
         pmc.walkSpeed     = 6;
         Destroy(gameObject);
     }
     if (DestroyCount >= SpawnCount)
     {
         SpawnCount += FlameSpawnRate;
         Instantiate(MovingFlame, transform.position, transform.rotation);
     }
 }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (!GameStatus.GamePaused && !GameStatus.FinisherModeActive)
        {
            if (buttonPressed && GameStatus.FinisherModeActive)
            {
                cancelAction = true;
                CurrentSword.GetComponent <ThrowLimb>().DestroyLine();
                return;
            }
            if (CurrentSword == null)
            {
                return;
            }
            if (Input.GetButtonDown("SpecialAttack"))
            {
                CMC.MoveToAimingLocation(false);
                buttonPressed = true;
            }
            if (Input.GetButton("SpecialAttack"))
            {
                if (CurrentSword != null && buttonPressed)
                {
                    CurrentSword.GetComponent <ThrowLimb>().ButtonHeld();
                }
            }
            if (Input.GetButtonUp("SpecialAttack"))
            {
                buttonPressed = false;
                if (cancelAction)
                {
                    CurrentSword.GetComponent <ThrowLimb>().DestroyLine();
                    cancelAction = false;
                    return;
                }
                CMC.ReturnFromAimingLocation();
                if (CurrentSword != null)
                {
                    CurrentSword.GetComponent <ThrowLimb>().ButtonReleased();
                }
                if (Swords.Count > 0)
                {
                    CurrentSword = Swords[0];
                    Swords.RemoveAt(0);
                    CurrentSword.transform.parent        = transform;
                    CurrentSword.transform.localPosition = Vector3.zero;
                    CurrentSword.transform.localRotation = Quaternion.identity;
                }
                else
                {
                    CurrentSword = null;
                }
            }
            int i = 0;
            foreach (GameObject sword in Swords)
            {
                sword.transform.parent = RotatingRing;
                switch (i)
                {
                case 0:
                    sword.transform.localPosition = Vector3.up * .2f;
                    break;

                case 1:
                    sword.transform.localPosition = Vector3.down * .2f;
                    break;

                case 2:
                    sword.transform.localPosition = Vector3.right * .2f;
                    break;

                case 3:
                    sword.transform.localPosition = Vector3.left * .2f;
                    break;
                }
                sword.transform.localRotation = Quaternion.identity;
                i++;
            }
            RotatingRing.Rotate(new Vector3(0, 0, 1));
        }
    }