private Task task_(string name, VoxelData[] datas, GeometryResult cb) { if (list_.Count == 0) { init (); } VoxelProduct product = new VoxelProduct (); begin_.setup (datas); TaskList tl = new TaskList (); tl.push(begin_.task (product)); for (int i = 0; i < list_.Count; ++i) { tl.push(list_[i].task (product)); } TaskManager.PushBack (tl, delegate { VoxelGeometry geometry = new VoxelGeometry (); geometry.draw (name, product, this.gameObject, this._material);; cb(geometry); }); return tl; }
public Task downTask() { TaskList tl = new TaskList (); VoxelMesh vm = this.gameObject.GetComponent<VoxelMesh>(); TweenTask tt = new TweenTask (delegate() { if(vm._offset.gameObject != null){ Tween tween = TweenLocalPosition.Begin(vm._offset.gameObject, 0.05f, new Vector3(0, 0, 3)); tween.method = Tween.Method.easeOutCubic; return tween; }else{ return null; } }); tl.push (tt); TweenTask t2 = new TweenTask (delegate() { if(vm._offset.gameObject != null){ Tween tween = TweenLocalPosition.Begin(vm._offset.gameObject, 0.05f, new Vector3(0, 0, 0)); tween.method = Tween.Method.easeInOutBounce; return tween; }else{ return null; } }); tl.push (t2); TaskManager.PushFront (tl, delegate { jetPower = true; }); TaskManager.PushBack (tl, delegate { //jetPower = _fire; refreshJet(); }); return tl; }
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 }
public Task loadTask() { TaskList tl = new TaskList (); if (!_isWebPlayer) { tl.push (_view._main.hideTask ()); } /* WebLoaderTask<VoxelJsonInfo> web = new WebLoaderTask<VoxelJsonInfo> ("http://localhost:8888/gdgeek/1/www/index.php/voxel/read"); web.onSucceed += delegate(VoxelJsonInfo info) { _model.voxel._data = VoxelReader.FromJsonData(info.data); _text.text = _model.voxel._data.ToString(); }; web.onError += delegate(string msg) { Debug.Log(msg); }; tl.push (web);*/ TaskManager.PushFront (tl, delegate { _text.text = "?????"; }); TaskManager.PushBack(tl, delegate{ VoxelJsonInfo info = VoxelJsonInfo.Load(json_); _model.voxel._data = VoxelReader.FromJsonData(info.data); _view.createMesh (_model.voxel); this.mesh_ = null; }); return tl; }
public Task show(int score, int best) { TaskList tl = new TaskList (); tl.push (_scoreText.setTextTask("SCORE")); tl.push (_score.setTextTask(score.ToString())); tl.push (_bestText.setTextTask("BEST")); tl.push (_best.setTextTask(best.ToString())); return tl; }
// Use this for initialization void Start() { TaskList tl = new TaskList (); tl.push (new TaskWait (0.5f)); Parameter p = new Parameter(); tl.push (this.shake (p)); TaskManager.Run (tl); }
public Task show() { TaskList tl = new TaskList (); tl.push(_speed.setTextTask("SPEED")); tl.push(_up.setTextTask("UP!")); tl.push (new TaskWait (0.5f)); tl.push (_speed.setTextTask ("")); tl.push (_up.setTextTask ("")); return tl; }
public Task next(string text) { TaskSet ts = new TaskSet (); TaskList tl = new TaskList (); tl.push (closeCharTask ()); tl.push (openCharTask (text)); ts.push (tl); ts.push (shake()); return ts; }
public Task run(Task task) { TaskList tl = new TaskList (); tl.push (packTask(task)); tl.push (hide ()); TaskManager.PushFront (tl, delegate { _cg.alpha = 0f; this.gameObject.SetActive(true); }); return 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; }
public State overState(string next) { StateWithEventMap swe = TaskState.Create (delegate() { TaskList tl = new TaskList(); tl.push (_hudText._score.clearTask()); Task task = _logo.resetTask(); tl.push (task); return tl; }, fsm_, next); swe.onOver += delegate { _health.value = 1.0f; GameManager.GetInstance().road.reset(); _vText.text = ""; }; return swe; }
public Task openCharTask(string text) { TaskSet ts = new TaskSet (); for (int i =0; i<_fonts.Length; ++i) { TaskList tl = new TaskList(); if(i < text.Length){ tl.push (new TaskWait(0.1f * i)); } tl.push (new TaskPack(_fonts[i].openTask)); ts.push(tl); } TaskManager.PushFront (ts, delegate{ this.write(text); }); return ts; }
public State showState() { StateWithEventMap state = TaskState.Create (delegate() { TaskList tl = new TaskList(); if(_model._score.score > _model._score.best){ _model._score.best = _model._score.score ; } tl.push (_hudText._score.show(_model._score.score, _model._score.best)); return tl;//; }, fsm_, prefix_ + ".input"); state.onStart += delegate { _hudText.open(); }; return state; }
private Task shake(int times, float time, Vector3 original, Vector3 border1, Vector3 border2) { TaskList tl = new TaskList (); int index = 0; float step = time / (float)(times); Debug.LogWarning (step); while (times > 0) { switch(index){ case 0: index = 1; times -= 1; tl.push (move(border1, step)); break; case 1: if(times >=2){ index -= 2; index = -1; tl.push (move(border2, 2 * step)); }else{ times-= 1; index = 0; tl.push (move( original, 2 * step)); } break; case -1: if(times >= 2){ times -= 2; index = 1; tl.push (move(border1, 2 * step)); }else{ times -= 1; index = 0; tl.push (move(original, step)); } break; } } return tl; }
private Task shake(bool d, Tween.Method method, int times, float time, Vector2 original, Vector2 border1, Vector2 border2){ TaskList tl = new TaskList (); int index = 0; float step = time / (float)(times); while (times > 0) { float radio = times*step/time; switch(index){ case 0: index = 1; times -= 1; tl.push (move(method, damp(d, original, border1, radio), step)); break; case 1: if(times >=2){ index -= 2; index = -1; tl.push (move(method, damp(d, original, border2, radio), 2 * step)); }else{ times-= 1; index = 0; tl.push (move(method, original, 2 * step)); } break; case -1: if(times >= 2){ times -= 2; index = 1; tl.push (move(method, damp(d, original, border1, radio), 2 * step)); }else{ times -= 1; index = 0; tl.push (move(method, original, step)); } break; } } return tl; }
// 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 Task loadTask() { TaskList tl = new TaskList (); Task load = new Task (); this._view._play.show(); Fly fly = _view._play.createFly("hero"); _dirver.position = new Vector3(0, -100, 0); _dirver.fly = fly; fly.doHurt += doHurt; _dirver.reset(); load.init = delegate { TempSound.GetInstance ().comeIn (); // AkSoundEngine.PostEvent ("ComeIn", this.gameObject); }; load.update = delegate(float d) { _dirver.move(_dirver.position + new Vector3(0, d*120, 0)); }; load.isOver = delegate() { if(_dirver.position.y > -60){ return true; } return false; }; load.shutdown = delegate { _dirver.move(new Vector3(0, -60, 0)); }; tl.push (_logo.openTask()); tl.push (_dirver.fly.downTask ()); tl.push (load); tl.push (_dirver.fly.upTask ()); TaskManager.PushBack (tl, delegate { GameManager.GetInstance().road.walk(); _level.building (); }); return tl; }
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; }
Task addTask(char ch, int count) { TaskList tl = new TaskList (); tl.push (new TaskWait (0.15f)); Task add = new TweenTask (delegate{ VoxelChar vc = _create.create(ch); if(vc != null){ vc.gameObject.SetActive(true); vc.setLayer(this.gameObject.layer); vc.gameObject.transform.SetParent(this.transform); vc.gameObject.transform.localScale = Vector3.one; vc.gameObject.transform.localPosition = getOffset(count, chars_.Count);//ew Vector3(chars_.Count * _offset, 0, 0); chars_.Add(vc); vc.setMainColor(_maincolor); vc.setLightColor(_lightColor); vc.gameObject.transform.eulerAngles = new Vector3(-270, 0, 0); return TweenRotation.Begin(vc.gameObject, 0.15f, Quaternion.Euler(new Vector3(0, 0, 0))); } return null; }); tl.push (add); return tl; }
private Task task_(VoxelProduct product) { TaskList tl = new TaskList (); tl.push (TaskLog.Logger(initVerticesTask(product.draw), "init_vertices")); tl.push (TaskLog.Logger(removeFacesTask(), "remove_face")); tl.push (TaskLog.Logger(updateVerticesAndTriangleOfProductTask(product), "update_vertices")); return tl; }
private Task initVerticesTask(VoxelDrawData data) { TaskList tl = new TaskList (); tl.push (TaskLog.Logger(initVertices0Task (data), "init_vertices0")); tl.push (TaskLog.Logger(initVertices1Task (data), "init_vertices1")); tl.push (TaskLog.Logger(initVertices2Task (), "init_vertices2")); tl.push (TaskLog.Logger(initVertices3Task (), "init_vertices3")); tl.push (TaskLog.Logger(initVertices4Task (), "init_vertices4")); return tl; }
public Task popTask(Sentence sentence) { TaskList tl = new TaskList (); tl.push (new TaskPack (delegate { return _popTask (sentence.talk, sentence.emotion); })); tl.push (new TaskWait (0.5f)); return tl; }
Task changeTask(int i, char ch, int count) { TaskList tl = new TaskList (); Task remove = new TweenTask (delegate{ chars_[i].gameObject.transform.eulerAngles = new Vector3(0, 0, 0); return TweenRotation.Begin(chars_[i].gameObject, 0.15f, Quaternion.Euler(new Vector3(270, 0, 0))); }); TaskManager.PushBack (remove, delegate { chars_[i].gameObject.SetActive(false); }); tl.push (remove); Task add = new TweenTask (delegate{ VoxelChar vc = _create.create(ch); if(vc != null){ vc.gameObject.SetActive(true); vc.setLayer(this.gameObject.layer); vc.setMainColor(_maincolor); vc.setLightColor(_lightColor); vc.gameObject.transform.SetParent(this.transform); vc.gameObject.transform.localScale = Vector3.one; vc.gameObject.transform.localPosition = this.getOffset(count, i); chars_[i] = vc; vc.gameObject.transform.eulerAngles = new Vector3(-270, 0, 0); return TweenRotation.Begin(vc.gameObject, 0.15f, Quaternion.Euler(new Vector3(0, 0, 0))); } return null; }); tl.push (add); return tl; }
public static TaskList AddTask(this TaskList list, Task task) { list.push(task); return(list); }