public Task _test() { TaskList tl = new TaskList(); TaskWait tw = new TaskWait(); tw.setAllTime(2.0f); tl.push(tw); Task open = this.openTask("B"); TaskManager.PushFront(open, delegate { write("从这两组图中选出你认为最"); }); tl.push(open); tl.push(new TaskWait(3.0f)); tl.push(next("八哥为什么关注了我司的!>")); tl.push(new TaskWait(3.0f)); tl.push(next("我司的八哥为什么关注了!>")); tl.push(new TaskWait(3.0f)); tl.push(closeTask()); return(tl); }
public static Task Create(float time) { TaskWait tw = new TaskWait(); tw.setAllTime(time); return(tw); }
public static TaskWait Create(float time, TaskShutdown shutdown) { TaskWait wait = new TaskWait(time); TaskManager.PushBack(wait, shutdown); return(wait); }
public static TaskList Wait(this TaskList list, float seconds) { var tw = TaskWait.Create(seconds, () => { }); list.push(tw); return(list); }
void Start() { _head.close (); _me.close (); _mePop.close (); _pop.close (); TaskList tl = new TaskList (); tl.push (new TaskWait (1.0f)); TaskSet ts = new TaskSet (); tl.push (_me.openTask()); tl.push (_head.openTask()); Task pop = _mePop.openTask ("那边的是楚云帆老师吗?"); tl.push (talk(pop)); tl.push (new TaskWait(2.0f)); tl.push (talk(_mePop.next("这次比赛能给高分么?"))); tl.push (_mePop.closeTask()); tl.push (talk2(_pop.openTask ("我有看过你的作品么?"))); TaskWait tw = new TaskWait (0.5f); TaskManager.PushBack (tw, delegate { _me.emotion = VoxelHead.Emotions.Surprise; }); tl.push (tw); TaskManager.Run (tl); //TaskManag }
private void DeathTree(){ TaskWait tw = new TaskWait(2f); TaskManager.PushFront(tw, delegate(){ this.gameObject.SetActive(false); _deathTree.gameObject.SetActive(true); }); TaskManager.PushBack(tw, delegate(){ _ctrl.fsmPost("end"); }); TaskManager.Run(tw); }
public Task dieTask() { //VoxelBlow b = new VoxelBlow (); //b.mesh = this.fly_.gameObject.GetComponent<VoxelMesh>(); Task die = new TaskWait(0.3f); TaskManager.PushFront (die, delegate { this.fly_._boom.emission(); this.fly_._mesh._mesh.gameObject.SetActive(false); this.fly_.jet = false; }); return die; }
// Use this for initialization void Start() { TaskList tl = new TaskList (); Task task1 = new Task (); task1.init = delegate() { Debug.Log("this is firs task!!!"); }; task1.isOver = delegate() { return true; }; tl.push (task1); TaskWait wait = new TaskWait (); wait.setAllTime (2f); tl.push (wait); Task task2 = new Task (); task2.init = delegate() { Debug.Log("this is second task!!!"); }; tl.push (task2); TaskSet mt = new TaskSet (); Task task3 = new Task (); task3.init = delegate() { Debug.Log("this is third task!!!"); }; task3.update = delegate(float d) { }; mt.push (task3); Task task4 = new Task (); task4.init = delegate() { Debug.Log("this is four task!!!"); }; mt.push (task4); TaskWait wait2 = new TaskWait (); wait2.setAllTime (5f); mt.push (wait2); Task task5 = new Task (); task5.init = delegate() { Debug.Log("this is five task!!!"); }; mt.push (task5); tl.push (mt); TaskManager.Run (tl); }
public Task openCurtainTask(int i) { TaskList tl = new TaskList(); TaskWait tw = new TaskWait(); tw.setAllTime(0.2f*i + 0.5f); tl.push (tw); TweenTask tq = new TweenTask (delegate() { Tween tween = TweenLocalPosition.Begin(_curtain[i].gameObject, 1.0f, new Vector3(_curtain[i].gameObject.transform.localPosition.x, -30, _curtain[i].gameObject.transform.localPosition.z)); tween.method = _curtainMethod; return tween; }); tl.push (tq); return tl; }
private State PlayState() { StateWithEventMap state = new StateWithEventMap(); state.onStart += delegate{ TaskWait tw = new TaskWait(2f); TaskManager.PushFront(tw, delegate(){ PlayPanelInit(); }); TaskManager.PushBack(tw, delegate(){ _black.SetBool("On", false); }); TaskManager.Run(tw); }; state.onOver += delegate{ }; state.addEvent("end", "end"); return state; }
public Task overTask() { TaskWait tw = new TaskWait (); /* tw.setAllTime (0.1f); //_body.AddForce TaskManager.PushFront (tw, delegate { _body.isKinematic = false; _body.useGravity = true; }); TaskManager.AddUpdate (tw, delegate(float d) { _body.AddForce(new Vector3(Random.Range(-50f, 50f), Random.Range(-50f, 50f),Random.Range(-10, -50f))); }); TaskManager.PushBack (tw, delegate { //_body.isKinematic = false; //_body.useGravity = true; });*/ return tw; }
private StateBase join() { State state = TaskState.Create(delegate { this.stateName = "join"; Task task = new GDGeek.TaskWait(0.3f); TaskManager.PushBack(task, delegate { NetworkSystem.SessionInfo session = NetworkSystem.Instance.sessions; if (session != null && NetworkSystem.Instance.running) { NetworkSystem.Instance.join(session); } }); return(task); }, this.fsm_, "scanning"); return(state); }
// Use this for initialization void Start() { var mesh = _manager.create (_fly3); mesh.gameObject.SetActive (false); Transformer a = new Transformer (); VoxelBlow b = new VoxelBlow (); a.from = _fly._data; a.to = _fly3._data; // b.data = _fly._data; b.mesh = _manager.create (_fly); TaskList tl = new TaskList (); TaskWait tw = new TaskWait (); tw.setAllTime (1.0f); tl.push (tw); tl.push (b.blow()); TaskManager.PushBack (tl, delegate { Debug.Log ("!!!!!!!"); b.mesh.gameObject.SetActive(false); }); TaskManager.Run (tl); }
private State BeginState() { StateWithEventMap state = new StateWithEventMap(); state.onStart += delegate{ _view._beginPanel.SetActive(true); _view._playPanel.SetActive(false); _view._endPanel.SetActive(false); _beginAnimator.SetBool("Go", true); }; state.onOver += delegate{ TaskWait tw = new TaskWait(2f); TaskManager.PushFront(tw, delegate(){ _black.SetBool("On", true); }); TaskManager.PushBack(tw, delegate(){ _view._beginPanel.SetActive(false); _view._playPanel.SetActive(true); }); TaskManager.Run(tw); }; state.addEvent("begin", "play"); return state; }
private StateBase IAmClient() { State state = TaskState.Create(delegate { Task task = new GDGeek.TaskWait(0.3f); TaskManager.PushBack(task, delegate { NetworkSystem.SessionInfo sessionInfo = this.getSessionInfo(); if (sessionInfo != null && networkSystem_.running) { networkSystem_.join(sessionInfo); } }); return(task); }, this.fsm_, delegate { if (Root.Instance.model.hasGod) { return("running"); } return("whoIsGod"); }); return(state); }
public Task _test() { TaskList tl = new TaskList (); TaskWait tw = new TaskWait (); tw.setAllTime (2.0f); tl.push (tw); Task open = this.openTask ("B"); TaskManager.PushFront (open, delegate { write ("从这两组图中选出你认为最"); }); tl.push (open); tl.push (new TaskWait(3.0f)); tl.push (next ("八哥为什么关注了我司的!>")); tl.push (new TaskWait(3.0f)); tl.push (next ("我司的八哥为什么关注了!>")); tl.push (new TaskWait(3.0f)); tl.push (closeTask ()); return tl; }
private State EndState() { StateWithEventMap state = new StateWithEventMap(); state.onStart += delegate{ TaskWait tw = new TaskWait(1.5f); TaskManager.PushBack(tw, delegate(){ _view._endPanel.SetActive(true); for(int i = 0; i < awardList_.Count; ++i){ DestroyImmediate(awardList_[i]); } for(int i = 0; i < enemyList_.Count; ++i){ DestroyImmediate(enemyList_[i]); } for(int i = 0; i < followerList_.Count; ++i){ DestroyImmediate(followerList_[i]); } for(int i = 0; i < rockList_.Count; ++i){ DestroyImmediate(rockList_[i]); } enemyList_.Clear(); followerList_.Clear(); rockList_.Clear(); _endAnimator.SetBool("Play", true); }); TaskManager.Run(tw); }; state.onOver += delegate{ TaskWait tw = new TaskWait(1f); TaskManager.PushFront(tw, delegate(){ _endAnimator.GetComponent<CanvasGroup>().alpha = 0; _endAnimator.SetBool("Play", false); }); TaskManager.PushBack(tw, delegate(){ _view._endPanel.SetActive(false); _endAnimator.GetComponent<CanvasGroup>().alpha = 1; }); TaskManager.Run(tw); }; state.addEvent("again", "again"); return state; }
public Task overTask() { TaskSet tl = new TaskSet (); for(int y = 0; y<_model.height; ++y){ for (int x =0; x < _model.width; ++x) { Cube c = _model.getCube(x, y); if(c.isEnabled){ Square s = _view.play.getSquare(x, y); tl.push (s.overTask()); } } } TaskWait tw = new TaskWait (); tw.setAllTime (0.5f); tl.push (tw); return tl; }
public static Task Create(float time){ TaskWait tw = new TaskWait (); tw.setAllTime (time); return tw; }
public State getTestState(){ StateWithEventMap state = TaskState.Create(delegate{ TaskWait wait = new TaskWait(0.1f); return wait; }, this.fsm_, delegate(FSMEvent evt) { MapCtrl map = this.getMap(); Vector3 target = getWorldTarget(); VectorInt2 cell = map.position2cell(new Vector2(target.x, target.z)); IMapData data = map.ask(cell); bool isPass = data.pass( map.position2cell( new Vector2(this._alien.gameObject.transform.position.x, this._alien.gameObject.transform.position.z))); if(isPass){ return "walk"; }else{ _director = Arrow.Stop; if(_arrow == Arrow.Right){ _arrow = Arrow.Left; }else{ _arrow = Arrow.Right; } //_arrow = Arrow.Stop; return "stop"; } }); return state; }
private void EnemyDeath() { TaskWait tw = new TaskWait(1f); TaskManager.PushFront(tw, delegate(){ _isMove = false; _animator.SetBool("Death", true); }); TaskManager.PushBack(tw, delegate(){ lifeNum_ = 10; for(int i = 0; i < _roockList.Length; ++i){ if(!_roockList[i].activeSelf){ _roockList[i].transform.position = this.transform.position; _roockList[i].SetActive(true); break; } } this.gameObject.SetActive(false); _animator.SetBool("Death", false); }); TaskManager.Run(tw); }
public static TaskWait Create(float time, TaskShutdown shutdown) { TaskWait wait = new TaskWait (time); TaskManager.PushBack (wait, shutdown); return wait; }
private State closeShare() { StateWithEventMap state = TaskState.Create (delegate { TaskWait tsk = new TaskWait(); tsk.setAllTime(3.0f); TaskManager.PushBack(tsk, delegate { WebPlayer.Close(); }); return tsk; }, fsm_, "idle"); return state; }