本文整理汇总了C#中Behave.Runtime.Tree类的典型用法代码示例。如果您正苦于以下问题:C# Tree类的具体用法?C# Tree怎么用?C# Tree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tree类属于Behave.Runtime命名空间,在下文中一共展示了Tree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TickKickBallAction
public BehaveResult TickKickBallAction(BLTree sender)
{
Debug.Log("Kick Ball");
ball.rigidbody.AddForceAtPosition(Vector3.forward * 100,ball.transform.position);
return BehaveResult.Success;
}
示例2: TickAccelAction
public BehaveResult TickAccelAction(Tree sender)
{
//Debug.Log ("Ticked Accel Action");
//Accelerate the ship if necessary
if(aiShip.Thrust < 10.0f &&
((Vector3.Distance(aiShip.transform.position, playerShip.transform.position) > aiShip.DesiredDistance + 10) ||
(Vector3.Distance(aiShip.transform.position, playerShip.transform.position) < aiShip.DesiredDistance - 10)))
{
aiShip.DesiredThrust = 10.0f;
//Debug.Log("Thrust set!");
}
else
{
//Debug.Log(aiShip.name);
//Debug.Log (playerShip.name);
aiShip.DesiredThrust = playerShip.transform.GetComponent<ShipController>().DesiredThrust;
//Debug.Log(aiShip.DesiredThrust);
}
if(aiShip.Moving)
{
return BehaveResult.Running;
}
else
{
return BehaveResult.Success;
}
}
示例3: TickEstoyApuntadoAction
public BehaveResult TickEstoyApuntadoAction(Tree sender)
{
Debug.Log ("Estoy apuntado?: "+ agente.estoyApuntado());
if (agente.estoyApuntado())
return BehaveResult.Success;
else
return BehaveResult.Failure;
}
示例4: TickIsGrabOutOfRangeAction
//SEEK
public BehaveResult TickIsGrabOutOfRangeAction(Tree sender)
{
if (wbc.IsGrabOutOfRange())
{
return BehaveResult.Success;
}
return BehaveResult.Failure;
}
示例5: TickApuntarAction
/*----Condicion--------------------------------*/
public BehaveResult TickApuntarAction(Tree sender)
{
Debug.Log ("Apuntar enemigo?: "+ agente.enemigoApuntado());
if (agente.enemigoApuntado())
return BehaveResult.Success;
else
return BehaveResult.Failure;
}
示例6: TickFreeTargetsAction
public BehaveResult TickFreeTargetsAction(Tree sender)
{
if (wbc.DetectsFreeTargets())
{
return BehaveResult.Success;
}
return BehaveResult.Failure;
}
示例7: TickIdleAction
public BehaveResult TickIdleAction(Tree sender)
{
if (wbc.DetectsFreeTargets())
{
return BehaveResult.Success;
}
return BehaveResult.Running;
}
示例8: TickIsInfectedAction
public BehaveResult TickIsInfectedAction(Tree sender)
{
if (rbc.IsInfected())
{
return BehaveResult.Success;
}
return BehaveResult.Failure;
}
示例9: TickIsAttachedAction
//DAMAGE
public BehaveResult TickIsAttachedAction(Tree sender)
{
if (wbc.IsAttached())
{
return BehaveResult.Success;
}
return BehaveResult.Failure;
}
示例10: TickDamageOverTimeAction
public BehaveResult TickDamageOverTimeAction(Tree sender)
{
if (wbc.IsAttachedTargetDead())
{
return BehaveResult.Failure;
}
return BehaveResult.Running;
}
示例11: TickIdleAction
public BehaveResult TickIdleAction(Tree sender)
{
if (rbc.IsInfected() || rbc.IsKilled())
{
return BehaveResult.Success;
}
return BehaveResult.Running;
}
示例12: Tick
public BehaveResult Tick(Tree sender, bool init)
{
Debug.Log("Ticked Received by unhandled " +
(BLNewBehaveLibrary0.IsAction(sender.ActiveID) ? "Action " :
"Decorator ") +
" ... " + (BLNewBehaveLibrary0.IsAction(sender.ActiveID) ?
((BLNewBehaveLibrary0.ActionType)sender.ActiveID).ToString() :
((BLNewBehaveLibrary0.DecoratorType)sender.ActiveID).ToString()));
return BehaveResult.Success;
}
示例13: Start
//Dette er grundstenen i Behave. I stedet for BLNewBehaveLibrary, skriver man sit eget navn
IEnumerator Start()
{
m_Tree = BLNewBehaveLibrary0.InstantiateTree(
BLNewBehaveLibrary0.TreeType.HeroAI1_NewTree1, this);
while (Application.isPlaying && m_Tree != null)
{
yield return new WaitForSeconds(1 / m_Tree.Frequency);
AIUpdate();
}
}
示例14: Start
IEnumerator Start()
{
m_tree = BLSimple.InstantiateTree(BLSimple.TreeType.SimpleCollection_SimpleTree,this);
while(Application.isPlaying && m_tree != null)
{
AIUpdate();
yield return new WaitForSeconds(1 / m_tree.Frequency);
}
}
示例15: Tick
public BehaveResult Tick(Tree sender, bool init)
{
//Shows up if there is an action or decorator that is unhandled in code.
Debug.Log("Got ticked by unhandled " +
(BLAIDemo.IsAction(sender.ActiveID) ? "action " : "decorator ") +
(BLAIDemo.IsAction(sender.ActiveID) ?
((BLAIDemo.ActionType)sender.ActiveID).ToString()
:
((BLAIDemo.DecoratorType)sender.ActiveID).ToString()
)
);
return BehaveResult.Success;
}