Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButton("Laser") && ready)
        {
            charging = true;
            ready    = false;

            if (Input.GetAxisRaw("Horizontal") == -1)
            {
                fireDirection = 4;
            }

            if (Input.GetAxisRaw("Horizontal") == 1)
            {
                fireDirection = 2;
            }

            if (Input.GetAxisRaw("Vertical") == -1)
            {
                status.setShootDown(true);
                fireDirection = 3;
            }

            if (Input.GetAxisRaw("Vertical") == 1)
            {
                fireDirection = 1;
            }
        }
        else
        {
            if (charging)
            {
                charging = false;
                firing   = true;
            }
        }


        if (status.getGrounded())
        {
            status.setKnocked(false);
            ready = true;
        }
    }