Ejemplo n.º 1
0
 private void Start()
 {
     agent          = GetComponent <NavMeshAgent>();
     parent         = stage.GetComponent <SimpleSonarShader_Parent>();
     sonar          = transform.Find("Sonar").gameObject.GetComponent <AudioSource>();
     companionDeath = transform.Find("companionDeath").gameObject.GetComponent <AudioSource>();
 }
Ejemplo n.º 2
0
    private void Update()
    {
        SimpleSonarShader_Parent parent = GetComponentInParent <SimpleSonarShader_Parent>();

        if (parent)
        {
            parent.StartSonarRing(transform.position, 10);
        }
    }
    void OnCollisionEnter(Collision collision)
    {
        // Start sonar ring from the contact point
        SimpleSonarShader_Parent parent = GetComponentInParent <SimpleSonarShader_Parent>();

        if (parent)
        {
            parent.StartSonarRing(collision.contacts[0].point, collision.impulse.magnitude / 20.0f);
        }
    }
Ejemplo n.º 4
0
 void Start()
 {
     vcam                 = GameObject.Find("VirtualCamera").GetComponent <CinemachineVirtualCamera>();
     m_Animator           = player.GetComponent <Animator>();
     parent               = stage.GetComponent <SimpleSonarShader_Parent>();
     Instance             = this;
     death                = false;
     numCaptures          = 0;
     prevFramenumCaptures = numCaptures;
     cellsLeftUI.GetComponent <TextMeshProUGUI>().text = "Cells Left: " + (numCellsInLevel - numCaptures).ToString();
     myEventSystem = GameObject.Find("EventSystem").GetComponent <UnityEngine.EventSystems.EventSystem>();
 }