本文整理汇总了C#中State.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# State.Initialize方法的具体用法?C# State.Initialize怎么用?C# State.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State
的用法示例。
在下文中一共展示了State.Initialize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Generate
public static State Generate(SyntaxNode declaration, SemanticModel semanticModel, OptionSet optionSet, bool isVariableDeclarationContext, CancellationToken cancellationToken)
{
var state = new State(isVariableDeclarationContext);
state.Initialize(declaration, semanticModel, optionSet, cancellationToken);
return state;
}
示例2: SetState
public void SetState(State nextState)
{
Assert.IsNotNull(nextState, "Next State is NULL");
Debug.Log("Passing from state " + currentState + " to " + nextState);
// Change the pivot of the current menu to set it outside of view
if (currentState)
//this.currentState.GetComponent<RectTransform>().pivot = closedMenuPivot;
currentState.gameObject.SetActive(false);
// Initialize the next state
nextState.Initialize();
// Set the current state to be the next state
currentState = nextState;
// Set the next state to be in view
//this.currentState.GetComponent<RectTransform>().pivot = openMenuPivot;
currentState.gameObject.SetActive(true);
}
示例3: SessionGameStartedHandler
void SessionGameStartedHandler(object sender, GameStartedEventArgs e)
{
if (Session.IsHost)
{
GlobalState = new GameState();
GlobalState.Initialize(null);
}
else
{
GlobalState = new ClientState();
GlobalState.Initialize(null);
}
GlobalState.LoadContent(Content);
HookGameStateEvents();
}
示例4: ReplayGameHandler
void ReplayGameHandler(object sender, EventArgs e)
{
UnhookHomeStateEvents();
GlobalState = new GameState();
GlobalState.Initialize(null);
GlobalState.LoadContent(Content);
HookGameStateEvents();
}
示例5: JoinGameHandler
void JoinGameHandler(object sender, EventArgs e)
{
AvailableNetworkSessionCollection sessions = NetworkSession.Find(NetworkSessionType.SystemLink, 2, null);
if (sessions.Count < 1)
return;
Session = NetworkSession.Join(sessions[0]);
if (Session != null)
{
HookSessionEvents();
UnhookHomeStateEvents();
GlobalState = new LobbyState();
GlobalState.Initialize(null);
GlobalState.LoadContent(Content);
HookLobbyStateEvents();
}
}
示例6: CreateGameHandler
void CreateGameHandler(object sender, EventArgs e)
{
try
{
Session = NetworkSession.Create(NetworkSessionType.SystemLink, 2, 2);
UnhookHomeStateEvents();
GlobalState = new LobbyState();
GlobalState.Initialize(null);
GlobalState.LoadContent(Content);
HookLobbyStateEvents();
HookSessionEvents();
}
catch (Exception exception)
{
}
}