public void Move(string id, Vector2 position, int speed = 0, EffectHolderNode observer = null) { GameObject go = GameObject.Find(id); Mover m = go.GetComponent <Mover>(); if (m != null) { if (speed == 0) { m.MoveInstant(position); } else { m.MoveFreely(position, observer, data => { EffectHolderNode tmp = (EffectHolderNode)data; tmp.doPulse(); Game.Instance.ContinueEffectExecution(); }, null); } } else { ScenePositioner r = go.GetComponent <ScenePositioner>(); r.Position = position; } }
private IEnumerator PulseOnTimeCorrutine(EffectHolderNode effect, int time) { yield return(new WaitForSeconds(time)); effect.doPulse(); Interacted(); }
private IEnumerator PulseOnTimeCorrutine(EffectHolderNode effect, int time) { pulsing++; yield return(new WaitForSeconds(time)); if (effect != null) { effect.doPulse(); } pulsing--; Interacted(); }