Beispiel #1
0
        public bool Remove(GameObject removeObject)
        {
            if (this.gameObjects.Contains(removeObject))
            {
                this.garbageList.Add(removeObject);
                return true;
            }

            return false;
        }
Beispiel #2
0
        public bool Add(GameObject newObject)
        {
            if (this.gameObjects.Contains(newObject))
            {
                return false;
            }

            this.gameObjects.Add(newObject);
            return true;
        }
Beispiel #3
0
        public bool Add(GameObject newObject, string nameOfState)
        {
            foreach (GameState gs in this.gameStates)
            {
                if(gs.name.Equals(nameOfState, StringComparison.OrdinalIgnoreCase))
                {
                    if (gs.gameObjects.Contains(newObject))
                    {
                        return false;
                    }

                    gs.gameObjects.Add(newObject);
                    return true;
                }
            }
               return false;
        }
Beispiel #4
0
        private void CheckForPixelCollision(GameObject objectA, GameObject objectB)
        {
            List<Sprite> objectAComponents = objectA.rendererComponents.GetChildren();
            List<Sprite> objectBComponents = objectB.rendererComponents.GetChildren();

            for (int aX = 0; aX < objectAComponents.Count(); aX++)
            {
                for (int bX = 0; bX < objectBComponents.Count(); bX++)
                {
                    if (PixelCollisionManager.Intersects(objectAComponents[aX], objectBComponents[bX]))
                    {
                        bool hej = true;
                    }
                }
            }
        }
 public RendererComponents(GameObject parent)
 {
     this.parent = parent;
     this.children = new List<Sprite>();
 }
Beispiel #6
0
        public bool Remove(GameObject removeObject, string nameOfState)
        {
            foreach (GameState gs in this.gameStates)
            {
                if(gs.name.Equals(nameOfState, StringComparison.OrdinalIgnoreCase))
                {
                    if (gs.gameObjects.Contains(removeObject))
                    {
                        GarbageObject go = new GarbageObject();
                        go.nameOfState = nameOfState;
                        go.gameObject = removeObject;
                        this.garbageList.Add(go);
                        return true;
                    }
                }
            }

            return false;
        }
Beispiel #7
0
 private void CheckForInput(GameObject gameObject, List<InputCommand> inputCommands)
 {
     foreach (InputCommand ic in inputCommands)
     {
         if (ic.isDown)
         {
             if (gameObject.identity.name.Equals(ic.objectName))
             {
                 MethodInfo method = gameObject.GetType().GetMethod(ic.methodName);
                 if (ic.thumbstick)
                 {
                     method.Invoke(gameObject, DynamicArray.ObjectArray(ic.parameters, ic.magnitude));
                 }
                 else
                 {
                     method.Invoke(gameObject, ic.parameters);
                 }
             }
             else if (ic.objectName.Equals("Camera"))
             {
                 MethodInfo method = GameManager.game.GetCameraManager().GetType().GetMethod(ic.methodName);
                 method.Invoke(GameManager.game.GetCameraManager(), ic.parameters);
             }
             else if (ic.objectName.Equals("Game"))
             {
                 MethodInfo method = GameManager.game.GetType().GetMethod(ic.methodName);
                 method.Invoke(GameManager.game, ic.parameters);
             }
         }
     }
 }
Beispiel #8
0
 /*Attempts to remove the GameObject from the game and returns true if it was successful, returns false if the GameObject wasn't found*/
 public bool RemoveObject(GameObject gameObject)
 {
     return orujin.gameObjectManager.Remove(gameObject);
 }
Beispiel #9
0
 /*Attempts to add the GameObject to the game and returns true if it was successful and there are no duplicates*/
 public bool AddObject(GameObject gameObject)
 {
     return orujin.gameObjectManager.Add(gameObject);
 }
Beispiel #10
0
 public void SetParent(GameObject parent)
 {
     Camera.SetParent(parent);
 }
Beispiel #11
0
 internal static void SetParent(GameObject newParent)
 {
     parent = newParent;
 }
Beispiel #12
0
 public bool AddObject(GameObject gameObject, string gameState)
 {
     return orujin.gameObjectManager.Add(gameObject, gameState);
 }
Beispiel #13
0
 public static void SetParent(GameObject newParent)
 {
     parent = newParent;
 }
Beispiel #14
0
 /*Attempts to add the GameObject to the game and returns true if it was successful and there are no duplicates*/
 public bool AddObject(GameObject gameObject)
 {
     return orujin.gameObjectManager.Add(gameObject, this.activeState);
 }
Beispiel #15
0
 public bool RemoveObject(GameObject gameObject, string gameState)
 {
     return orujin.gameObjectManager.Remove(gameObject, gameState);
 }
Beispiel #16
0
 /*Attempts to remove the GameObject from the game and returns true if it was successful, returns false if the GameObject wasn't found*/
 public bool RemoveObject(GameObject gameObject)
 {
     return orujin.gameObjectManager.Remove(gameObject, this.activeState);
 }
Beispiel #17
0
 public void Render(GameObject gameObject)
 {
     this.Render(gameObject.GetRendererComponents());
 }
Beispiel #18
0
 public void SetParent(GameObject parent)
 {
     this.parent = parent;
 }