本文整理汇总了C#中State.Start方法的典型用法代码示例。如果您正苦于以下问题:C# State.Start方法的具体用法?C# State.Start怎么用?C# State.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State
的用法示例。
在下文中一共展示了State.Start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateState
// State Changing Commands
public void CreateState(String s_Key, State.BaseState s_State)
{
dGameStates[s_Key] = s_State;
s_State.Start(_Content);
}
示例2: ChangeState
/// <summary>
/// Changes to the given <paramref name="newState"/>.
/// </summary>
/// <param name="newState">The <see cref="State"/> to change to.</param>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="newState"/> is null.</exception>
private void ChangeState(State newState)
{
// validate arguments
if (newState == null)
throw new ArgumentNullException("newState");
// if we are disposed of do not change the state
if (IsDisposed)
{
// dispose the new state
newState.Dispose();
return;
}
// dispose the current state if there is one
if (currentState != null)
currentState.Dispose();
// set the new state
currentState = newState;
// start the new state
newState.Start();
}
示例3: AddState
/// <summary>
///
/// </summary>
/// <param name="state"></param>
public void AddState( State state )
{
States.Add( state.Name, state );
state.Owner = this;
state.Start();
}