Example #1
0
    /*!
     * Checks for any updates that need to be applied to game world
     * such as if a player has held down the shoot button
     */
    void Update()
    {
        /*!
         * Unused Osucircle testing function
         */
        if (Input.GetKeyDown(KeyCode.Q))
        {
            //creates game object
            GameObject osu_Circle = Instantiate(OsuCircle);

            //displaces the circle 2 times its size above player
            float displacement = osu_Circle.transform.localScale.x * 50;

            //sets postions and parent
            osu_Circle.transform.SetParent(GameObject.FindGameObjectWithTag("UIController").transform);
            osu_Circle.transform.position = new Vector2(Screen.width / 2, Screen.height / 2 + displacement);
        }

        if (Input.GetButtonDown("Fire2"))         //! @note Fire2 is the default mousebutton 2 on PC, but can be used on other platforms when defining global controlls

        {
            //if (finalHit == null)
            spellController.StartSpawnSequence();
            playerIsFiring = true;
        }
        if (Input.GetButtonUp("Fire2"))
        {
            spellController.EndSpawnSequence();
            //GameObject.FindGameObjectWithTag("Player").GetComponent<Player>().PlayerArrowAttack();
            playerIsFiring = false;
        }
    }