Beispiel #1
0
        private void InvokeCommand(GameEventCommand eventCommand)
        {
            this.index++;
            if (eventCommand.objectTag != null)
            {
                foreach (GameObject gameObject in GameManager.game.FindObjectsWithTag(eventCommand.objectTag))
                {
                    MethodInfo method = gameObject.GetType().GetMethod(eventCommand.methodName);
                    method.Invoke(gameObject, eventCommand.parameters);
                }
            }
            else
            {
                if (eventCommand.objectName.Equals("Camera"))
                {
                    MethodInfo method = GameManager.game.GetCameraManager().GetType().GetMethod(eventCommand.methodName);
                    method.Invoke(GameManager.game.GetCameraManager(), eventCommand.parameters);
                }
                else if (eventCommand.objectName.Equals("Game"))
                {
                    MethodInfo method = GameManager.game.GetType().GetMethod(eventCommand.methodName);
                    method.Invoke(GameManager.game, eventCommand.parameters);
                }
                else
                {
                    GameObject gameObject = GameManager.game.FindObjectWithName(eventCommand.objectName);
                    MethodInfo method = gameObject.GetType().GetMethod(eventCommand.methodName);
                    method.Invoke(gameObject, eventCommand.parameters);
                }

            }
        }
Beispiel #2
0
 private void InvokeCommand(GameEventCommand eventCommand)
 {
     this.index++;
     if (eventCommand.objectTag != null)
     {
         foreach (GameObject gameObject in GameManager.game.FindObjectsWithTag(eventCommand.objectTag))
         {
             MethodInfo method = gameObject.GetType().GetMethod(eventCommand.methodName);
             method.Invoke(gameObject, eventCommand.parameters);
         }
     }
     else
     {
         if (eventCommand.objectName.Equals("Camera"))
         {
             MethodInfo method = GameManager.game.GetCameraManager().GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game.GetCameraManager(), eventCommand.parameters);
         }
         else if (eventCommand.objectName.Equals("Game"))
         {
             MethodInfo method = GameManager.game.GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game, eventCommand.parameters);
         }
         else
         {
             GameObject gameObject = GameManager.game.FindObjectWithName(eventCommand.objectName);
             MethodInfo method     = gameObject.GetType().GetMethod(eventCommand.methodName);
             method.Invoke(gameObject, eventCommand.parameters);
         }
     }
 }
 private void InvokeCommand(GameEventCommand eventCommand)
 {
     this.index++;
     if (eventCommand.objectTag != null)
     {
         foreach (GameObject gameObject in GameManager.game.FindObjectsWithTag(eventCommand.objectTag))
         {
             MethodInfo method = gameObject.GetType().GetMethod(eventCommand.methodName);
             method.Invoke(gameObject, eventCommand.parameters);
         }
     }
     else
     {
         if (eventCommand.objectName.Equals("Camera"))
         {
             MethodInfo method = GameManager.game.GetCameraManager().GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game.GetCameraManager(), eventCommand.parameters);
         }
         else if (eventCommand.objectName.Equals("Game"))
         {
             MethodInfo method = GameManager.game.GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game, eventCommand.parameters);
         }
         else if (eventCommand.objectName.Equals("Renderer"))
         {
             MethodInfo method = GameManager.game.GetRendererManager().GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game.GetRendererManager(), eventCommand.parameters);
         }
         else if (eventCommand.objectName.Equals("Debug"))
         {
             MethodInfo method = GameManager.game.GetDebugManager().GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game.GetDebugManager(), eventCommand.parameters);
         }
         else if (eventCommand.objectName.Equals("Menu"))
         {
             MethodInfo method = GameManager.game.GetMenuManager().GetType().GetMethod(eventCommand.methodName);
             method.Invoke(GameManager.game.GetMenuManager(), eventCommand.parameters);
         }
         else if (eventCommand.objectName.Equals("Hud"))
         {
             HudManager.hud.ActivateItem((string)eventCommand.parameters[0]);
         }
         else
         {
             GameObject gameObject = GameManager.game.FindObjectWithName(eventCommand.objectName);
             MethodInfo method     = gameObject.GetType().GetMethod(eventCommand.methodName);
             method.Invoke(gameObject, eventCommand.parameters);
         }
     }
 }
 public GameEvent(GameEventCommand ev)
 {
     this.eventCommands = new List <GameEventCommand>();
     this.eventCommands.Add(ev);
     this.finished = false;
 }
Beispiel #5
0
 public GameEvent(GameEventCommand ev)
 {
     this.eventCommands = new List<GameEventCommand>();
     this.eventCommands.Add(ev);
     this.finished = false;
 }