コード例 #1
0
 /// <summary>
 /// Instantiates a Follower with all of the specified parameters
 /// </summary>
 /// <param name="newObject">The GameObject that this Follower will represent</param>
 /// <param name="newPathProgress">Where (from 0-1) the object will start</param>
 /// <param name="newBehaviour">The following behaviour this Follower will use</param>
 /// <param name="newEndEvent">The EndPathEvent this Follower will use</param>
 /// <param name="newSpeed">The speed this Follower will have</param>
 public Follower(GameObject newObject, float newPathProgress, ePathBehaviour newBehaviour, eEndPathEvent newEndEvent, float newSpeed)
 {
     followerObject = newObject;
     pathProgress   = newPathProgress;
     behaviour      = newBehaviour;
     endEvent       = newEndEvent;
     speed          = newSpeed;
     relaPos        = newObject.transform.position; //Saves home position, to be changed to actual relaPos once added to a Path
 }
コード例 #2
0
 /// <summary>
 /// Instantiates a Follower with specified object and speed, the rest are default
 /// </summary>
 /// <param name="newObject">The GameObject that this Follower will represent</param>
 /// <param name="newSpeed">The speed this Follower will have</param>
 public Follower(GameObject newObject, float newSpeed)
 {
     followerObject = newObject;
     pathProgress   = 0;
     behaviour      = BasePath.ePathBehaviour.ABSOLUTE;
     endEvent       = BasePath.eEndPathEvent.STOP;
     speed          = newSpeed;
     relaPos        = newObject.transform.position;
 }