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


C# StateID.ToString方法代码示例

本文整理汇总了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());
    }
开发者ID:kreeds,项目名称:TestProjectDemo,代码行数:31,代码来源:FSMState.cs

示例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;
 }
开发者ID:GeorgeDon,项目名称:MyPrivate,代码行数:19,代码来源:FSMsystem.cs

示例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);
 }
开发者ID:GeorgeDon,项目名称:MyPrivate,代码行数:19,代码来源:FSMstate.cs

示例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");
    }
开发者ID:kurainisei,项目名称:SpaceVehicle,代码行数:25,代码来源:FSMSystem.cs

示例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.");
     }
 }
开发者ID:Parzival42,项目名称:Bread,代码行数:22,代码来源:FiniteStateMachine.cs

示例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.");
 }
开发者ID:daxaxelrod,项目名称:Loom-Vr,代码行数:18,代码来源:BankFiniteStateMachine.cs

示例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");
	}
开发者ID:longde123,项目名称:pathfinding,代码行数:19,代码来源:FSMSystem.cs

示例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());
    }
开发者ID:kreeds,项目名称:TestProjectDemo,代码行数:21,代码来源:FiniteStateMachine.cs

示例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");
    }
开发者ID:SabiKov,项目名称:HumanEvolution2,代码行数:18,代码来源:NPCStateManager.cs


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