示例#1
0
    private void Update()
    {
        bool hasHook = gHook.HasHook;

        if (Input.GetButtonDown("Fire1"))
        {
            if (hasHook)
            {
                gHook.DestroyHook();
            }
            else
            {
                gHook.FireHook();
            }
        }

        if (Input.GetButtonUp("Fire1"))
        {
            //gHook.DestroyHook();
        }

        if (Input.GetButtonDown("Fire2") && !hasHook)
        {
            rLauncher.FireRocket();
        }

        if (Input.GetButton("Jump"))
        {
            jetpack.FireJetpack();
            jetpack.Active = true;
        }
        else
        {
            jetpack.Active = false;
        }

        if (!hasHook)
        {
            targetMouse.PhysicsMoveToMouse();
        }
    }