本文整理汇总了C#中AgentData类的典型用法代码示例。如果您正苦于以下问题:C#AgentData类的具体用法?C#AgentData怎么用?C#AgentData使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:CreateAgent
voidCreateAgent(Coordcoordinates,GameObjectagent,floatelevation)
{
varagentData=newAgentData(){coords=newint[]{coordinates.X,coordinates.Y},prefId=_agentInfoIDs[agent.name]};
vargo=Instantiate(agent,Grid.CoordToPosition(coordinates)+(1+elevation)*Vector3.up,Quaternion.AngleAxis(45,Vector3.up))asGameObject;
go.active=false;
foreach(varcompingo.GetComponents
())
{
if(!compisRenderer)
{
if(compisMonoBehaviour)
{
(compasMonoBehaviour).enabled=false;
}
}
}
foreach(varcompingo.GetComponentsInChildren())
{
if(!compisRenderer)
{
if(compisMonoBehaviour)
{
(compasMonoBehaviour).enabled=false;
}
}
}
agentData.obj=go;
_agentObjects.Add(go);
_agents.Add(agentData);
go.active=true;
}
原文链接:http://www.jxszl.com/biancheng/C/556493.html