public override void OnMouseDown() { if (Store.Regime == Store.TestRegime.Record) { int idx = getFreeIndicators(); if (idx < 0) { return; } Sender.AddEvent(getEventName(), Store.Priority, getEventHandler()); GameObject go = Instantiate(getIndicator()) as GameObject; go.transform.position = transform.position; Sputnik i = go.GetComponentInChildren <Sputnik>(); if (i == null) { i = go.AddComponent <Sputnik>(); } go.transform.parent = this.gameObject.transform; i.Init(getEventName(), getEventHandler(), Store.Priority); i.MyPlanet = this; CreateEventReaction(); } if (Store.Regime == Store.TestRegime.Play) { waitPlaying = true; // When Play is clicked, wait for 3 seconds if (center == null) { center = FindObjectOfType <CenterController4>(); } if (center != null) { center.timeRemaining = 4.0f; } } }
// Use this for initialization void Awake() { if (text == null) { text = GetComponent <Text>(); } Sender.AddEvent(EventName.SCORE_INIT, hnScoreInit); }
// Use this for initialization void Awake() { for (int i = 0; i < maxIndicator; i++) { indicators[i] = null; } Population = Random.value * 5000; Radius = Random.value * 40 + 15; Sender.AddEvent(EventName.E_CHANGE, hnChangeStatus); }
public override void OnMouseDown() { if (Store.Regime == Store.TestRegime.Record) { int idx = getFreeIndicators(); if (idx < 0) { return; } Sender.AddEvent(getEventName(), Store.Priority, getEventHandler()); GameObject go = Instantiate(getIndicator()) as GameObject; go.transform.position = transform.position; Sputnik i = go.GetComponentInChildren <Sputnik>(); if (i == null) { i = go.AddComponent <Sputnik>(); } go.transform.parent = this.gameObject.transform; i.Init(getEventName(), getEventHandler(), Store.Priority); i.MyPlanet = this; CreateEventReaction(); } }
private void Awake() { Sender.AddEvent(EventName.DESTROYER, hnDestroyer); }