Ejemplo n.º 1
0
    IEnumerator AddHiddenHandler()
    {
        //wait for all the components to be disabled on the
        //player before adding the handler
        yield return(new WaitForEndOfFrame());

        closetHandlerCache = playerScript.gameObject.AddComponent <ClosetPlayerHandler>();
    }
Ejemplo n.º 2
0
    public void RpcBeforeBodyTransfer()
    {
        ClosetPlayerHandler cph = GetComponent <ClosetPlayerHandler>();

        if (cph != null)
        {
            Destroy(cph);
        }

        //no more input can be sent to the body.
        GetComponent <MouseInputController>().enabled = false;
    }
Ejemplo n.º 3
0
    private void RpcAdjustForRespawn()
    {
        ClosetPlayerHandler cph = GetComponent <ClosetPlayerHandler>();

        if (cph != null)
        {
            Destroy(cph);
        }
        Camera2DFollow.followControl.damping = 0.0f;
        playerScript.ghost.SetActive(false);
        isGhost = false;
        //Hide ghosts and show FieldOfView
        Camera.main.cullingMask &= ~(1 << LayerMask.NameToLayer("Ghosts"));
        Camera.main.cullingMask |= 1 << LayerMask.NameToLayer("FieldOfView");
        gameObject.GetComponent <InputController>().enabled = false;
    }
Ejemplo n.º 4
0
    private void RpcBeforeGhost()
    {
        //only need to clean up client side if we are controlling the body who is becoming a ghost
        //no more closet handler, they are dead
        ClosetPlayerHandler cph = GetComponent <ClosetPlayerHandler>();

        if (cph != null)
        {
            Destroy(cph);
        }

        //no more input can be sent to the body.
        MouseInputController mouseInput = GetComponent <MouseInputController>();

        if (mouseInput != null)
        {
            Destroy(mouseInput);
        }
    }