本文整理汇总了C#中IState.OnInit方法的典型用法代码示例。如果您正苦于以下问题:C# IState.OnInit方法的具体用法?C# IState.OnInit怎么用?C# IState.OnInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IState
的用法示例。
在下文中一共展示了IState.OnInit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeState
static void ChangeState(IState state)
{
if (curState != null)
curState.OnExit();
curState = state;
if (curState != null)
curState.OnInit();
}
示例2: ChangeState
public void ChangeState(IState state)
{
if (curstate != null)
curstate.OnExit();
curstate = state;
if (curstate != null)
curstate.OnInit(this);
}
示例3: ChangeState
public void ChangeState(IState state)
{
if (curState != null)
{
curState.OnExit();
}
curState = state;
if (curState != null)
{
curState.OnInit();
}
}
示例4: ChangeState
void ChangeState(IState state,GameObject ui)
{
GameObject uiRoot = GameObject.Find("UI Root (2D)/Camera/Anchor");
if (curState != null)
{
if(curUiObj!=null)
{
GameObject.Destroy(curUiObj);
}
curState.OnExit();
}
curState = state;
curUiObj = ui;
if (curState != null)
{
if(curUiObj!=null)
{
curUiObj.transform.parent = uiRoot.transform;
curUiObj.transform.localScale = Vector3.one;
curUiObj.transform.localPosition = Vector3.zero;
}
curState.OnInit(this,curUiObj);
}
}