public void updateNearbyStation(GameObject g) { nearbyStation = g; BaseQTE baseQTE = g.GetComponent <BaseQTE>(); if (baseQTE) { nearbyStationQTE = g.GetComponent <BaseQTE>(); } }
void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "Player") { Debug.Log("PLAYER ENTER"); collider.gameObject.SendMessage("updateNearbyStation", gameObject); BaseQTE baseQTE = gameObject.GetComponent <BaseQTE>(); if (baseQTE) { baseQTE.activatingPlayer = collider.gameObject; } } else if (collider.gameObject.tag == "Hero") { collider.gameObject.GetComponent <HeroController>().enterDropoff(); } }
public void resetNearbyStation() { nearbyStation = null; nearbyStationQTE = null; }