Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 public void Follow(GameObject obj)
 {
     this.obj = obj;
     this.offset = Vector3.Zero;
     position = obj.Position;
     rotation = obj.Rotation;
     //obj.Visible = false;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 public void Unfollow()
 {
     obj.Visible = true;
     obj = null;
 }
Ejemplo n.º 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);
 }