コード例 #1
0
    public void RecoverFromFall()
    {
        //SOUND GOT UP
        //AkSoundEngine.PostEvent("GotUp", gameObject);

        InputController.SetCanAttach(true);
        InputController.BlockControls(false);
        ResetBar();
        BlockBar(true, 5f);

        BalanceGUI.SetActive(true);
        IconImage.SetActive(true);

        Hips.GetComponent <SpringJoint>().spring = 1000f;
        Hips.GetComponent <Rigidbody>().AddForce(Vector3.up * 250f);

        NetworkServerManager.getInstance().ServerStringMessageSender(InputController, "GotUp");
    }
コード例 #2
0
    public void Fall()
    {
        if (!Fallen)
        {
            Fallen = true;

            BlockBar(true);

            InputController.RandomizeControls();
            InputController.Detach();
            InputController.BlockControls(true);
            InputController.SetCanAttach(false);

            BalanceGUI.SetActive(false);
            IconImage.SetActive(false);

            Hips.GetComponent <SpringJoint>().spring = 0f;
            Hips.GetComponent <Rigidbody>().velocity = Vector3.zero;

            NetworkServerManager.getInstance().ServerStringMessageSender(InputController, "Fallen");
            ShootKeys(MatchManager.getInstance().keyCollected[gameObject.layer - 9]);
            MatchManager.getInstance().keyCollected[gameObject.layer - 9] = 0;
        }
    }