void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            AutomatedPlayerMovement autoPlayerMove = other.GetComponent <AutomatedPlayerMovement>();
            autoPlayerMove.StopMove();
            autoPlayerMove.SetDirection(Vector3.forward);
            ReturnGem();

            StartCoroutine(WaitAndLoadNextScene());
        }
    }
Exemple #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            AutomatedCannonUsage    autoCannonUsage = other.GetComponent <AutomatedCannonUsage>();
            AutomatedPlayerMovement autoPlayerMove  = other.GetComponent <AutomatedPlayerMovement>();

            autoPlayerMove.StopMove();
            autoCannonUsage.FireCannon();

            StartCoroutine(WaitAndLoadNextScene());
        }
    }
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            AutomatedPlayerMovement autoPlayerMove = other.GetComponent <AutomatedPlayerMovement>();
            autoPlayerMove.StopMove();
            AutomatedPlayerAttack autoPlayerAttack = other.GetComponent <AutomatedPlayerAttack>();

            autoPlayerAttack.Swing();

            StartCoroutine(WaitAndLoadNextScene());
        }
    }
Exemple #4
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            AutomatedPlayerMovement autoPlayerMove  = other.GetComponent <AutomatedPlayerMovement>();
            AutomatedCannonUsage    autoCannonUsage = other.GetComponent <AutomatedCannonUsage>();
            autoPlayerMove.StopMove();
            autoCannonUsage.PickupCannonball();
            autoPlayerMove.TurnDegrees(false, 45f);
            autoPlayerMove.StartMoveForward();

            cannonInstructionText.text = secondInstructionText;
        }
    }
Exemple #5
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            AutomatedPlayerMovement autoPlayerMove = other.GetComponent <AutomatedPlayerMovement>();
            AutomatedPlayerStealGem autoSealGem    = other.GetComponent <AutomatedPlayerStealGem>();
            autoPlayerMove.StopMove();
            autoSealGem.ShowXIndicator();
            autoPlayerMove.SetDirection(Vector3.left);
            autoPlayerMove.TurnDegrees(true, 90f);
            autoSealGem.StealGem();
            autoPlayerMove.TurnDegrees(true, 180f);

            autoPlayerMove.SetDirection(Vector3.right);
            autoPlayerMove.StartMoveForward();

            StartCoroutine(DelayAndTurn(autoPlayerMove));

            this.backToBoatB4PlankTrigger.SetActive(true);
            this.backToBoatAfterPlankTrigger.SetActive(true);

            mainCamera.transform.position = secondCameraPosition.position;
        }
    }