private void Start() { module = FrameworkModule.CreatInstance <ECSModule>("", ""); module.SubscribeSystem(new PlayerSystem(module)); module.SubscribeSystem(new PCSystem(module)); var player = module.CreateEntity <SimpleEntity>(); player.AddComponent <PlayerComponent>(); var playerRO = player.AddComponent <RotaComponet>(); playerRO.go = UnityEngine.GameObject.CreatePrimitive(UnityEngine.PrimitiveType.Cube); playerRO.go.name = "Player"; playerRO.go.transform.position = new UnityEngine.Vector3(0, -2, 0); var pc = module.CreateEntity <SimpleEntity>(); pc.AddComponent <SpeedComponent>(); pc.AddComponent <PCComponent>(); var pcRO = pc.AddComponent <RotaComponet>(); pcRO.go = UnityEngine.GameObject.CreatePrimitive(UnityEngine.PrimitiveType.Cube); pcRO.go.name = "Pc"; pcRO.go.transform.position = new UnityEngine.Vector3(0, 2, 0); }
private void Start() { mo = FrameworkModule.CreatInstance <CoroutineModule>("", ""); this.Sequence(EnvironmentType.Ev0) .Repeat((r) => { r.Sequence((s) => { s.TimeSpan(new TimeSpan(0, 0, 5)) .Event(() => { Log.L("GG"); }) .OnCompelete(() => { Log.L("comp"); }) .OnBegin(() => { Log.L("begin"); }); }) ; }, 2) .TimeSpan(new TimeSpan(0, 0, 5)) .OnCompelete((ss) => { /*ss.Reset();*/ }) .OnRecyle(() => { Log.L(""); }) .Run(mo); }
private void Start() { fsm = FrameworkModule.CreatInstance <FsmModule>("", ""); State1 s1 = new State1(); State2 s2 = new State2(); fsm.SubscribeState(s1); fsm.enterState = s1; fsm.SubscribeState(s2); // fsm.exitState = s2; var val = fsm.CreateConditionValue <bool>("bool", true); var t1 = fsm.CreateTransition(s1, s2); var t2 = fsm.CreateTransition(s2, s1); t1.BindCondition(fsm.CreateCondition <bool>("bool", false, CompareType.Equals)); t2.BindCondition(fsm.CreateCondition <bool>(val, true, CompareType.Equals)); fsm.Start(); }