Exemple #1
0
 public void Start()
 {
     if (this.isLocalPlayer)
     {
         Instance_ = this;
     }
 }
Exemple #2
0
        private StateBase whoIsGod()
        {
            State state = TaskState.Create(delegate {
                if (_hasAnchor)
                {
                    Root.Instance.view.board.state = InfoBoard.State.Hide;
                }
                else
                {
                    Root.Instance.view.board.state = InfoBoard.State.Scan;
                }

                Task task = new Task();
                TaskManager.AddAndIsOver(task, delegate
                {
                    return(Root.Instance.model.hasGod);
                });
                return(task);
            }, this.fsm_, "running");

            state.addAction(Ctrl.AnchorEvent, delegate
            {
                WhoIsGod wid = Altar.LocalComponent <WhoIsGod>();
                wid.IAmGod();
            });
            state.onStart += delegate
            {
                _stateName = "whoIsGod";

                Debug.Log("state:" + _stateName);
            };


            return(state);
        }
Exemple #3
0
        private void synchro()
        {
            BroadcastingStation bs = Altar.LocalComponent <BroadcastingStation>();

            if (bs)
            {
                bs.broadcasting(this);
            }
        }
Exemple #4
0
 public bool isItMe()
 {
     if (Model.Instance.hasGod)
     {
         Hero hero = Altar.LocalComponent <Hero>();
         return(Model.Instance.godId == hero.data.id);
     }
     return(true);
 }
Exemple #5
0
        public void setValue(int value)
        {
            value_ = value;
            BroadcastingStation bs = Altar.LocalComponent <BroadcastingStation>();

            if (bs)
            {
                bs.broadcasting(this);
            }
        }
Exemple #6
0
        private StateBase alone()
        {
            State state = TaskState.Create(delegate {
                WhoIsGod wid = null;
                Task task    = new Task();
                TaskManager.AddAndIsOver(task, delegate
                {
                    wid = Altar.LocalComponent <WhoIsGod>();
                    return(wid != null);
                });
                TaskManager.PushBack(task, delegate
                {
                    wid.IAmGod();
                });
                return(task);
            }, this.fsm_, "running");

            return(state);
        }