public static LogicRuntimeMachine NewLogicRuntimeMachine(string fileName) { LogicObjectContainer container = LogicObjectDataController.GetDataFromFile(fileName); int id = GetId; LogicRuntimeMachine lom = new LogicRuntimeMachine(id, container); logicMachineDic.Add(id, lom); return(lom); }
public void DispatchEvent(string eventName, params object[] args) { localEvent.DispatchEvent(eventName, args); List <int> list = new List <int>(internalLogicMachineDic.Values); for (int i = 0; i < list.Count; i++) { LogicRuntimeMachine lom = LogicSystemManager.GetLogicRuntimeMachine(list[i]); lom.DispatchEvent(eventName, args); } }
public void Init(LogicRuntimeMachine logicManager) { this.logicManager = logicManager; for (int i = 0; i < logicObjs.Count; i++) { LogicObject to = logicObjs[i]; if (to.id == startId) { to.Init(logicManager); } else if (to.isSupportAlwaysActive) { to.Init(logicManager); } } }
public void Init(LogicRuntimeMachine logicManager) { this.logicManager = logicManager; if (isInit) { return; } isInit = true; events.Init(this); conditions.Init(this); actions.Init(this); if (events.Count == 0) { RunConditionCompare(); } logicManager.runningLogicObjects.Add(id); }
protected override void Action() { LogicRuntimeMachine lom = LogicSystemManager.NewLogicRuntimeMachine(logicMachineFileName); logicObject.logicManager.AddChildLogicMachine(controlName, lom.Id); lom.Start(); }
// Use this for initialization void Start() { logicManager = LogicSystemManager.NewLogicRuntimeMachine(logicFileName); logicManager.AddRuntimeGameObjects("target", gameObject); logicManager.Start(); }