public void OnTriggerEnter(Collider other) { if (tags.Equals(other.tag)) { collidings++; pointing = other.gameObject.GetComponent <PodiumController> (); } }
private void pickup() { PodiumController pointed = pointer.getPointing(); if (pointed != null) { carry = pointed.TakeItem(); } }
private void drop() { PodiumController pointed = pointer.getPointing(); if (pointed != null && pointed.isEmpty()) { GameObject aux = carry; carry = null; pointed.PlaceItem(aux); } }
public void OnTriggerExit(Collider other) { if (tags.Equals(other.tag)) { collidings--; if (collidings == 0) { pointing = null; } } }
public void GeneratePodiums() { // Get all the position available for a spawning for (int i = 0; i < m_spawnPos.Length; i++) { // Pick a random number for the type of podium int index = Random.Range(0, 3); // Instantiate a podium at a unique position from the array GameObject aPodium = Instantiate(m_podiums[index], m_spawnPos[i].position, m_spawnPos[i].rotation); PodiumController pc = aPodium.GetComponent <PodiumController>(); pc.gm = GameObject.Find("GM"); pc.m_items = m_items; pc.SelectModel(); } }
// Use this for initialization void Start() { pointing = null; collidings = 0; }