当前位置: 首页>>代码示例>>C#>>正文


C# State.Enter方法代码示例

本文整理汇总了C#中State.Enter方法的典型用法代码示例。如果您正苦于以下问题:C# State.Enter方法的具体用法?C# State.Enter怎么用?C# State.Enter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在State的用法示例。


在下文中一共展示了State.Enter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeState

 public void ChangeState(State newState)
 {
     lastState = currentState;
     currentState.Exit(this.gameObject);
     newState.Enter(this.gameObject);
     currentState = newState;
 }
开发者ID:ColterCvach,项目名称:SleeperAgent,代码行数:7,代码来源:FiniteStateMachine.cs

示例2: ChangeGlobalState

 public void ChangeGlobalState(State newState)
 {
     if (globalState != null)
     {
         globalState.Exit(owner);
     }
     globalState = newState;
     globalState.Enter(owner);
 }
开发者ID:Bigalan09,项目名称:Evolution,代码行数:9,代码来源:StateMachine.cs

示例3: SetState

 public void SetState(StateID stateID)
 {
     if(!states.ContainsKey(stateID))
         return;
     if(currentState != null)
         currentState.Leave();
     currentState = states[stateID];
     currentState.Enter();
 }
开发者ID:SkaterDanny,项目名称:3D-DreamTeam,代码行数:9,代码来源:StateMachine.cs

示例4: ChangeState

 public void ChangeState(State newState)
 {
     if (newState == null)
         return;
     mPreviousState = mCurrentState;
     mCurrentState.Exit (mOwner);
     mCurrentState = newState;
     mCurrentState.Enter (mOwner);
 }
开发者ID:abelsiqueira,项目名称:cronicas-de-medrash,代码行数:9,代码来源:FSM.cs

示例5: MoveTo

 public void MoveTo(State _state)
 {
     if(state != null) state.Exit();
     state = _state;
     if(state != null) {
         state.sm = this;
         state.Enter();
     }
 }
开发者ID:IlyaBokovenko,项目名称:spear-fishing,代码行数:9,代码来源:StateMachine.cs

示例6: ChangeState

 public void ChangeState(State newState)
 {
     if (currentState != null)
     {
         previousState = currentState;
         currentState.Exit(owner);
     }
     currentState = newState;
     currentState.Enter(owner);
 }
开发者ID:Bigalan09,项目名称:Evolution,代码行数:10,代码来源:StateMachine.cs

示例7: Update

 public void Update(GameObject gameObject)
 {
     State newState = mCurrState.Update(gameObject);
     if (newState != null)
     {
         mCurrState.Exit();
         mCurrState = newState;
         mCurrState.Enter();
     }
 }
开发者ID:TheGovernorsJunk,项目名称:CaulsCastle,代码行数:10,代码来源:StateMachine.cs

示例8: Start

    void Start()
    {
        _anim = GetComponent<Animator>();
        _fighterRef = this.gameObject.GetComponent<Fighter>();
        _myRigidbody = GetComponent<Rigidbody2D>();
        _currentState = new EnemyPatrolState(this);
        _currentState.Enter();

        GameController.Instance().GetEnemyList.Add(this.gameObject);
    }
开发者ID:chozoace,项目名称:ProjectAnubis,代码行数:10,代码来源:EnemyAI.cs

示例9: Push

 public void Push(State state)
 {
     State old = Peek();
     if (old != null)
     {
         old.Exit();
     }
     states.Push(state);
     state.Enter();
 }
开发者ID:Ryxali,项目名称:Passpartout,代码行数:10,代码来源:FSM.cs

示例10: SetState

 public virtual void SetState(State state)
 {
     if(_currentState != null)
     {
         _currentState.Exit();
     }
     _currentState = state;
     _currentState.StateMachine = this;
     _currentState.Enter();
 }
开发者ID:kdawghomie,项目名称:ScopelyTest,代码行数:10,代码来源:StateMachine.cs

示例11: Transition

 public void Transition(State fromState,State toState)
 {
     if (SwapState(fromState,toState))
     {
         toState.Enter();
     }
     else
     {
         throw new IllegalStateException("Illegal transition attempted from: " + fromState + " to " + toState);
     }
 }
开发者ID:rmiller1971,项目名称:akka.net,代码行数:11,代码来源:CircuitBreaker.cs

示例12: ChangeState

        /// <summary>
        /// Change the Miner State.
        /// </summary>
        /// <param name="newState">Miner State to change to.</param>
        public void ChangeState(State<Miner> newState)
        {
            //exit current state and change to new state.
            currentState.Exit(this, Location);

            //change the state.
            Location = newState.GetLocation();
            currentState = newState;

            //enter new state.
            currentState.Enter(this);
        }
开发者ID:AMagicRake,项目名称:ArtificialIntelligencePractice,代码行数:16,代码来源:Miner.cs

示例13: ChangeState

    public void ChangeState(State newState)
    {
        if (currentState != null)
        {
            currentState.Exit();
        }

        currentState = newState;
        if (newState != null)
        {
            currentState.Enter();
        }
    }
开发者ID:Rabaen,项目名称:GClarkeBryansAI_Assignment,代码行数:13,代码来源:StateMachine.cs

示例14: SwitchState

    public void SwitchState( State newState )
    {
        if (currentState != null) {
            currentState.Exit();
        }

        currentState = newState;

        if (currentState != null) {

            currentState.Enter();
        }

        Debug.Log ("Switching to state for: " + newState.entity.name);
    }
开发者ID:BuildingJarl,项目名称:GE2_Assignment,代码行数:15,代码来源:StateManager.cs

示例15: SetState

	/// <summary>
	/// Method om de state te wijzigen
	/// </summary>
	public void SetState(StateID stateID) {

		/** als we de stateID niet kennen als state: stop deze functie dan */
		if(!states.ContainsKey(stateID))
			return;

		/** als we ons al in een state bevinden: geef de state de mogelijkheid zich op te ruimen */
		if(currentState != null)
			currentState.Leave();

		/** we stellen de nieuwe currentState in */
		currentState = states[stateID];

		/** we geven de nieuwe state de mogelijkheid om zich zelf in te stellen */
		currentState.Enter();
	}
开发者ID:18839,项目名称:Mythe,代码行数:19,代码来源:StateMachine.cs


注:本文中的State.Enter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。