예제 #1
0
        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);
        }
예제 #2
0
파일: TaskWait.cs 프로젝트: shzhuan/shzhuan
        public static Task Create(float time)
        {
            TaskWait tw = new TaskWait();

            tw.setAllTime(time);
            return(tw);
        }
예제 #3
0
파일: TaskWait.cs 프로젝트: lzxkulou/GDGeek
        public static TaskWait Create(float time, TaskShutdown shutdown)
        {
            TaskWait wait = new TaskWait(time);

            TaskManager.PushBack(wait, shutdown);
            return(wait);
        }
예제 #4
0
        public static TaskList Wait(this TaskList list, float seconds)
        {
            var tw = TaskWait.Create(seconds, () => { });

            list.push(tw);
            return(list);
        }
예제 #5
0
파일: Test.cs 프로젝트: gdgeek/fly
        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
        }
예제 #6
0
 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);
 }
예제 #7
0
파일: Dirver.cs 프로젝트: gdgeek/fly
 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;
 }
예제 #8
0
    // 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);
    }
예제 #9
0
파일: Logo.cs 프로젝트: gdgeek/fly
 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;
 }
예제 #10
0
 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;
 }
예제 #11
0
    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;
    }
예제 #12
0
        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);
        }
예제 #13
0
파일: Ctrl.cs 프로젝트: gdgeek/fly
        // 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);
        }
예제 #14
0
 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;
 }
예제 #15
0
        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);
        }
예제 #16
0
        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;
        }
예제 #17
0
 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;
 }
예제 #18
0
    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;
    }
예제 #19
0
		public static Task Create(float time){
			TaskWait tw = new TaskWait ();
			tw.setAllTime (time);
			return tw;
		}
예제 #20
0
파일: AlienCtrl.cs 프로젝트: CzDreamer/eat
	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;


	}
예제 #21
0
 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);
 }
예제 #22
0
파일: TaskWait.cs 프로젝트: gdgeek/fly
 public static TaskWait Create(float time, TaskShutdown shutdown)
 {
     TaskWait wait = new TaskWait (time);
     TaskManager.PushBack (wait, shutdown);
     return wait;
 }
예제 #23
0
파일: Ctrl.cs 프로젝트: gdgeek/fly
 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;
 }