Exemple #1
0
 public void Follow(GameObject obj, Vector3 offset)
 {
     this.obj = obj;
     this.offset = offset;
     position = obj.Position + offset;
     rotation = obj.Rotation;
     //obj.Visible = false;
 }
Exemple #2
0
 public void Follow(GameObject obj)
 {
     this.obj = obj;
     this.offset = Vector3.Zero;
     position = obj.Position;
     rotation = obj.Rotation;
     //obj.Visible = false;
 }
Exemple #3
0
 /// <summary>
 /// Add a game object to the list.
 /// </summary>
 /// <param name="obj">The game object to add.</param>
 public void Add(GameObject obj)
 {
     obj.Parent = this;
     for (int i = 0; i < gameObjects.Count; i++)
     {
         if (gameObjects[i].Layer > obj.Layer)
         {
             gameObjects.Insert(i, obj);
             return;
         }
     }
     gameObjects.Add(obj);
 }
Exemple #4
0
 /// <summary>
 /// This game object handles the input of a target game object.
 /// </summary>
 /// <param name="target">The target game object to move. Can be null for none.</param>
 public MovementHandler(GameObject target = null)
     : base("movementHandler", -1)
 {
     Target = target;
 }
Exemple #5
0
 public void Unfollow()
 {
     obj.Visible = true;
     obj = null;
 }
Exemple #6
0
 /// <summary>
 /// Removes a game object from the list.
 /// </summary>
 /// <param name="obj">The game object to remove.</param>
 public void Remove(GameObject obj)
 {
     obj.Parent = null;
     gameObjects.Remove(obj);
 }