// Update is called once per frame
    void Update()
    {
        transform.SetAsLastSibling();
        if (startTutorial)
        {
            if (ManageInputType(tutorials[index]))
            {
                tutorials[index].SetActive(false);
                if (index < tutorials.Length - 1)
                {
                    index += 1;
                    tutorials[index].SetActive(true);
                }
                else
                {
                    tutorials[index].SetActive(false);
                    if (player != null)
                    {
                        player.activeTutorial = false;
                        player = null;
                    }

                    if (disableAtEnd)
                    {
                        gameObject.SetActive(false);
                    }
                }
            }
        }
    }
Example #2
0
 void Die(PlayerControllerThirdPersonVR player)
 {
     animator.enabled = false;
     agent.enabled    = false;
     foreach (Rigidbody rb in GetComponentsInChildren <Rigidbody>())
     {
         rb.isKinematic = false;
         rb.AddForce(player.moveDirection * 100);
     }
 }
 //delete this ?
 void OnTriggerEnter(Collider other)
 {
     if ((other.tag == "Player") && !startTutorial)
     {
         print("here");
         player = other.gameObject.GetComponent <PlayerControllerThirdPersonVR>();
         player.activeTutorial = true;
         other.gameObject.GetComponent <PlayerControllerThirdPersonVR>().activeTutorial = true;
         startTutorial = true;
         tutorials[index].SetActive(true);
     }
 }
Example #4
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         if ((other.gameObject.GetComponent <Animator>().GetBool("Roll") == true) && !dead)
         {
             dead = true;
             Instantiate(coin, transform.position, Quaternion.identity);
             Instantiate(coin, transform.position, Quaternion.identity);
             PlayerControllerThirdPersonVR player = other.gameObject.GetComponent <PlayerControllerThirdPersonVR>();
             GetComponent <SphereCollider>().isTrigger = true;
             Die(player);
             rigid.AddForce(player.moveDirection);
         }
         else if ((other.gameObject.GetComponent <Animator>().GetBool("Roll") == false) && !dead)
         {
             PlayerControllerThirdPersonVR player = other.gameObject.GetComponent <PlayerControllerThirdPersonVR>();
             player.animator.SetBool("Hit", true);
         }
     }
 }
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            if (enablesJumping)
            {
                PlayerControllerThirdPersonVR cont = other.gameObject.GetComponent <PlayerControllerThirdPersonVR>();
                cont.jumpEnabled = true;
            }
            else if (enablesRolling)
            {
                PlayerControllerThirdPersonVR cont = other.gameObject.GetComponent <PlayerControllerThirdPersonVR>();
                cont.rollEnabled = true;
            }
        }

        if (setLine)
        {
            if (other.tag == "Player")
            {
                LineController controller = other.gameObject.GetComponent <LineController>();
                controller.activeLine = lineNum;
            }
        }
        if (noTutorial)
        {
            return;
        }
        if (other.tag == "Player" && !tutorial.startTutorial)
        {
            tutorial.player = other.gameObject.GetComponent <PlayerControllerThirdPersonVR>();
            tutorial.player.activeTutorial = true;
            tutorial.startTutorial         = true;
            tutorial.tutorials[tutorial.index].SetActive(true);
        }
    }