コード例 #1
0
 public BowAttackBehavior(string targetCategory, float shootDistance, float maxDistance)
     : base(targetCategory, Arrow.FlightSpeed, maxDistance: maxDistance)
 {
     _followBehavior = new FollowBehavior(targetCategory, shootDistance)
     {
         MaxDistance = maxDistance
     };
     TimeBetweenAttacks = TimeSpan.FromSeconds(2);
 }
コード例 #2
0
 /// <summary>
 /// Creates the follow behavior with the desired follow entity and the distance to keep.
 /// </summary>
 /// <param name="following">The entity to follow.</param>
 /// <param name="distance">The desired distance to keep.</param>
 public SwordAttackBehavior(string targetCategory)
 {
     _followBehavior = new FollowBehavior(targetCategory, distance: 24);
 }