本文整理汇总了C#中StateID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# StateID.ToString方法的具体用法?C# StateID.ToString怎么用?C# StateID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateID
的用法示例。
在下文中一共展示了StateID.ToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTransition
// Add Transition
public void AddTransition(Transition trans, StateID id)
{
//check if transition exist
if(trans == Transition.NULL)
{
Debug.LogError("Trying to add a null transition");
return;
}
if(id == StateID.NULL)
{
Debug.LogError("Trying to add a null state");
return;
}
if(trans == Transition.E_NOHP)
{
Debug.Log("trans: " + trans.ToString() + " StateID: " + id.ToString());
}
// check if current map already contains key
if(map.ContainsKey(trans))
{
Debug.LogError(trans.ToString() + " transition Exist, unable to have duplicate transitions for State: " + id.ToString());
return;
}
map.Add(trans, id);
Debug.Log("Sucessfully added: " + trans.ToString() + " id extract: " + map[trans] + " Current StateID: " + STATE_ID.ToString());
}
示例2: DeleteState
public void DeleteState(StateID id)
{
if(id==StateID.NullStateID)
{
Debug.LogError("FSM ERROR:状态机中不可能存在空状态");
return;
}
foreach(FSMState state in states)
{
if(state.ID==id)
{
states.Remove(state);
state.StateChange-=StateChange;
return;
}
}
Debug.LogError ("FSM ERROR:状态机中的不存在ID为"+id.ToString()+"的状态");
return;
}
示例3: AddTransition
public void AddTransition(Transition trans,StateID id)
{
if(trans==Transition.NullTransition)
{
Debug.LogError("FSM ERROR:map中转换不能为NullTransition");
return;
}
if(id==StateID.NullStateID)
{
Debug.LogError("FSM ERROR:空状态标签不能添加到map中,而且一个实际的状态标签不能为空");
return;
}
if(map.ContainsKey(trans))
{
Debug.LogError(id.ToString()+"FSM ERROR:已经存在"+trans.ToString()+"的转换了");
return;
}
map.Add(trans,id);
}
示例4: DeleteState
/// <summary>
/// This method delete a state from the FSM List if it exists,
/// or prints an ERROR message if the state was not on the List.
/// </summary>
public void DeleteState(StateID id)
{
// Check for NullState before deleting
if (id == StateID.NullStateID)
{
Debug.LogError("FSM ERROR: NullStateID is not allowed for a real state");
return;
}
// Search the List and delete the state if it's inside it
foreach (FSMState state in states)
{
if (state.ID == id)
{
states.Remove(state);
return;
}
}
Debug.LogError("FSM ERROR: Impossible to delete state " + id.ToString() +
". It was not on the list of states");
}
示例5: DeleteState
/// <summary>
/// Deletes a state if it exists.
/// </summary>
/// <param name="id">State id</param>
public void DeleteState(StateID id)
{
if (id == StateID.NullStateID)
Debug.LogError("FSMSystem: NullStateID not allowed!");
else
{
//Search for the state.
foreach (FSMState state in states)
{
if (state.ID == id)
{
states.Remove(state);
return; // :(
}
}
Debug.LogError("FSMState: State with the id " + id.ToString() + " was not found.");
}
}
示例6: DeleteState
// next method deletes a state from FSM list if it already exists
// or prints an error message if the state should exist but doesnt.
public void DeleteState(StateID id)
{
// check if its a null state
// if so, someone fucked up, make sure that the state is instanciated at some point if you want to delete it
if (id == StateID.NullStateID) {
Debug.LogError("FSM error, the id passed in is not a real state");
return;
}
foreach (FSMState state in states) {
if (state.ID == id) {
states.Remove(state);
return;
}
}
Debug.LogError("FRM error. impossible to delete state " + id.ToString() + ". it was not in the list of states.");
}
示例7: DeleteState
public void DeleteState(StateID id)
{
if(id == StateID.NullStateID)
{
Debug.LogError("FSM Error: NullStateID is not allowed for a real state");
return;
}
foreach(FSMState state in states)
{
if(state.ID == id)
{
states.Remove(state);
return;
}
}
Debug.LogError("FSM Error: Impossible to delete state " + id.ToString() + ". It was not on the list of the states");
}
示例8: DeleteState
// Delete State
public void DeleteState(StateID id)
{
if(id == StateID.NULL)
{
Debug.LogError("Unable to Delete Null State");
return;
}
foreach(FSMState s in states)
{
if(s.STATE_ID == id)
{
states.Remove(s);
return;
}
}
// Unable to locate State
Debug.LogError("Unable to locate state with StateID: " + id.ToString());
}
示例9: DeleteState
public void DeleteState(StateID id)
{
if (id == StateID.NullStateID)
{
Debug.LogError("StateManager DeleteState(): NullStateID!");
return;
}
foreach (NPCState state in states)
{
if (state.ID == id)
{
states.Remove(state);
return;
}
}
Debug.LogError("StateManager DeleteState(): " + id.ToString() + " not in list");
}