public bool Remove(GameObject removeObject) { if (this.gameObjects.Contains(removeObject)) { this.garbageList.Add(removeObject); return true; } return false; }
public bool Add(GameObject newObject) { if (this.gameObjects.Contains(newObject)) { return false; } this.gameObjects.Add(newObject); return true; }
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; }
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>(); }
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; }
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); } } } }
/*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); }
/*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); }
public void SetParent(GameObject parent) { Camera.SetParent(parent); }
internal static void SetParent(GameObject newParent) { parent = newParent; }
public bool AddObject(GameObject gameObject, string gameState) { return orujin.gameObjectManager.Add(gameObject, gameState); }
public static void SetParent(GameObject newParent) { parent = newParent; }
/*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); }
public bool RemoveObject(GameObject gameObject, string gameState) { return orujin.gameObjectManager.Remove(gameObject, gameState); }
/*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); }
public void Render(GameObject gameObject) { this.Render(gameObject.GetRendererComponents()); }
public void SetParent(GameObject parent) { this.parent = parent; }