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>(); }
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); } }
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>(); }