// Use this for initialization void Start() { try { GameObject stageGameObject = GameObject.Find("Stage"); Stage stage = stageGameObject.GetComponentInChildren <Stage> () as Stage; Add(stage); Kiwii kiwii = stageGameObject.GetComponentInChildren <Kiwii> () as Kiwii; Add(kiwii); } catch (KeyNotFoundException e) { Debug.Log(e.ToString()); } }
IEnumerator Execute_Co() { _status = eChuckStatus.RUNNING; ActionData actionData = ActionManager.Instance.GetActionData(actionGuid); if (actionData != null) { Kiwii kiwii = ActorManager.Instance.Get(Actor.eCharactor.KIWII) as Kiwii; kiwii.gameObject.BroadcastMessage(actionData.CallFunctionName); Debug.Log("Action:" + actionData.CallFunctionName); } switch (this.name) { case "Rule1": case "Rule2": case "Rule3": timeLength = 100; break; } DateTime begin = DateTime.Now; while (true) { TimeSpan processed = DateTime.Now.Subtract(begin); if (processed.TotalMilliseconds > timeLength) { break; } else { yield return(new WaitForSeconds(0.1f)); } } _status = eChuckStatus.DONE; yield return(null); }