Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        if (activeCamera_ == null)
        {
            activeCamera_ = Camera.main;
        }

        if (playerTalkCoordinator == null)
        {
            playerTalkCoordinator = GetComponent <PlayerTalkCoordinator>();
        }

        audio_ = GetComponent <AudioSource>();

        isWeb = Application.platform != RuntimePlatform.WebGLPlayer;

        if (isWeb)
        {
            Input.simulateMouseWithTouches = true;
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter(Collider other)
    {
        if (playerLayerMask_ == (playerLayerMask_ | (1 << other.gameObject.layer)))
        {
            PlayerTalkCoordinator player = other.GetComponent <PlayerTalkCoordinator>();
            if (player == null)
            {
                Debug.LogError("Entered trigger of chracter who is not NPC.");
                return;
            }

            if (player.TeleportTo(pointToTeleportTo_.transform.position, this, pointToTeleportTo_))
            {
                CharacterMovement movement = player.GetComponent <CharacterMovement>();
                movement.ActiveCamera = pointToTeleportTo_.associatedCamera_;
                player.ActiveCamera   = pointToTeleportTo_.associatedCamera_;

                SwitchCamAndLights(false);
                pointToTeleportTo_.SwitchCamAndLights(true);
            }
        }
    }