public void ShowReactHud(MapReactor reactor) { GameObject HudHint = Resources.Load <GameObject>("ReactorHint"); GameObject h = GameObject.Instantiate(HudHint, reactor.transform.position + new Vector3(0, 0.4f), Quaternion.identity, root); hints.Add(h); }
public void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Reactor") { MapReactor reactor = collision.GetComponent <MapReactor>(); if (!ActivateReactors.Contains(reactor)) { ActivateReactors.Add(reactor); OldGameMain.GetInstance().gameMode.HudRoot.ShowReactHud(reactor); } } }
public void OnTriggerExit2D(Collider2D collision) { if (collision.tag == "Reactor") { MapReactor reactor = collision.GetComponent <MapReactor>(); if (ActivateReactors.Contains(reactor)) { int idx = ActivateReactors.IndexOf(reactor); ActivateReactors.Remove(reactor); OldGameMain.GetInstance().gameMode.HudRoot.HideReactHud(idx); } } }