示例#1
0
    public override void Update()
    {
        /*Follow Leader
         *      stick close to leader (don't chase x distance away)
         *      Kill anything immediately around
         *      Assist in anything the leader does
         * Berserk
         *      Kill anything immediately around
         *      Look for and chase down enemies
         *
         */

        base.Update();
//		if(target!=null && Vector3.Distance(Location,target.position)>1f)//Am I going somewhere
//		{
//			movement = (target.position-Location).normalized;
//			animSpeed = 1f;
//			//agent.destination = target.position;
//			mover.Move(movement);
//		}else{//we don't have a target, or we've arrived
//			animSpeed = 0f;
//			if(IsTargetingEnemy())
//			{
//				Vector3 enemyVector = targetEnemy.Location-Location;
//
//				if(Vector3.Dot(enemyVector,movement)>0)//am I facing the enemy
//				{
//					if(canAttack)
//					{
//						Attack();
//					}
//				}else{
//					//mover.Move(enemyVector);
//				}
//			}else

        BehaviourState.AssesSituation();
        //Animate();
    }
示例#2
0
 public override void Update()
 {
     base.Update();
     BehaviourState.AssesSituation();
     Animate();
 }