private void FixedUpdate()
    {
        if (controls.menu)
        {
            overlayController.Enable(true);
            fire1 = false;
            if (fire2)
            {
                fire2 = false;
                wand.Fire2(false);
            }
        }
        else if (overlayController.isEnabled)
        {
            overlayController.Enable(false);
        }

        if (!controls.menu)
        {
            fire1 = controls.mousedown_1;
            fire2 = controls.mousedown_2;

            if (!fire2 && Wand.channeling)
            {
                wand.Fire2(false);
            }
        }

        if (fire1)
        {
            wand.Fire1();
            fire1 = false;
        }
        if (fire2 && !Wand.channeling)
        {
            wand.Fire2(true);
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.LeftAlt))
        {
            menu = true;
            overlayController.Enable(true);
            fire1    = false;
            holding1 = false;
            if (fire2)
            {
                fire2 = false;
                wand.Fire2(false);
            }
        }
        if (Input.GetKeyUp(KeyCode.LeftAlt))
        {
            menu = false;
            overlayController.Enable(false);
        }


        if (!menu)
        {
            /*
             * if (Input.GetMouseButtonDown(0) && !holding1 && allowFiring)
             * {
             *  fire1 = true;
             *  holding1 = true;
             *  allowFiring = false;
             *  Invoke("Fire1Timer", 1f);
             * }
             * if (Input.GetMouseButtonUp(0))
             * {
             *  holding1 = false;
             * }
             *
             * if (Input.GetMouseButtonDown(1) && Mathf.Abs(letGo-lastHeld) >= 1f)
             * {
             *  lastHeld = Time.time;
             *  fire2 = true;
             * }
             * if (Input.GetMouseButtonUp(1))
             * {
             *  fire2 = false;
             *  wand.Fire2(false);
             *  letGo = Time.time;
             * }
             */
            if (Input.GetMouseButtonDown(0))
            {
                fire1 = true;
            }
            else if (Input.GetMouseButtonUp(0))
            {
                fire1 = false;
            }

            if (Input.GetMouseButtonDown(1))
            {
                fire2 = true;
            }
            else if (Input.GetMouseButtonUp(1))
            {
                wand.Fire2(false);
                fire2 = false;
            }
        }
    }