示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            //player.GetComponent<PlayerControllerRun>().ControlDisabling();

            PlayerControllerRun             playerCR   = other.GetComponent <PlayerControllerRun>();
            PlayerControllerRunNoFreeCamera playerCRFC = other.GetComponent <PlayerControllerRunNoFreeCamera>();
            PlayerControllerRunJoypad       playerCRC  = other.GetComponent <PlayerControllerRunJoypad>();


            if (playerCR.enabled)
            {
                playerCR.ControlDisabling();
                playerCR.resetSpeed();
            }
            if (playerCRFC.enabled)
            {
                playerCRFC.ControlDisabling();
                playerCRFC.resetSpeed();
            }
            if (playerCRC.enabled)
            {
                playerCRC.ControlDisabling();
                playerCRC.resetSpeed();
            }
        }
    }
示例#2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            PlayerControllerRun             playerCR   = other.GetComponent <PlayerControllerRun>();
            PlayerControllerRunNoFreeCamera playerCRFC = other.GetComponent <PlayerControllerRunNoFreeCamera>();
            PlayerControllerRunJoypad       playerCRC  = other.GetComponent <PlayerControllerRunJoypad>();


            if (playerCR.enabled)
            {
                playerCR.ControlDisabling();
                playerCR.resetSpeed();
                playerCR.applyForce(target.position - transform.position, VerticalSpeed);
            }
            if (playerCRFC.enabled)
            {
                playerCRFC.ControlDisabling();
                playerCRFC.resetSpeed();
                playerCRFC.applyForce(target.position - transform.position, VerticalSpeed);
            }
            if (playerCRC.enabled)
            {
                playerCRC.ControlDisabling();
                playerCRC.resetSpeed();
                playerCRC.applyForce(target.position - transform.position, VerticalSpeed);
            }
        }
    }