Example #1
0
 // Use this for initialization
 void Start()
 {
     controller = gameObject.GetComponent<RigidbodyFirstPersonController>();
     defaultFoV = camera.fieldOfView;
     xSens = controller.mouseLook.XSensitivity;
     ySens = controller.mouseLook.YSensitivity;
 }
Example #2
0
    void Awake()
    {
        // Setting up the references.
        //		this.anim = this.GetComponent<Animator>();
        //		this.playerAudio = this.GetComponent<AudioSource>();
        this.playerMovement = this.GetComponent<RigidbodyFirstPersonController>();
        //		this.playerShooting = this.GetComponentInChildren<PlayerShooting>();

        // Set the initial health of the player.
        this.currentHealth = this.startingHealth;
    }
Example #3
0
    void Awake()
    {
        slowSpeed = 6f;
        fastSpeed = 15f;
        minRotationSpeed = 2f;
        maxRotationSpeed = 10f;
        rotationSpeedMultiplier = 4f;
        thisCam = GetComponent<Camera> ();
        thisCam.enabled = true;

        endPlatformTransform = GameObject.Find("End Platform").transform;
        fpc = GameObject.FindObjectOfType<RigidbodyFirstPersonController> ();
        playerCameraTransform = fpc.transform.GetChild (0);
        fpc.enabled = false;

        StartCoroutine ( EnableCameras (false));
        StartCoroutine ( Move ());
    }
Example #4
0
 void Initialise()
 {
     playerMovementController = GameObject.FindObjectOfType<RigidbodyFirstPersonController>();
     playerActionController = GameObject.FindObjectOfType<PlayerActionController>();
 }
 // Start is called before the first frame update
 void Start()
 {
     rbController = GetComponent <RigidbodyFirstPersonController>();
     animator     = GetComponent <Animator>();
 }
Example #6
0
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     cc = GetComponent <RigidbodyFirstPersonController>();
 }
Example #7
0
 private void TeleportObject(GameObject teleportee)
 {
     Vector3 originalLocation = (Vector3)objectLocations[teleportee];
     float actualDot = Vector3.Dot(transform.forward, originalLocation - transform.position);
     Vector3 offset = Vector3.zero;
     if (actualDot < 0)
     {
         offset = transform.position - (transform.forward * 0.05f);
     }
     else if (actualDot > 0)
     {
         offset = transform.position + (transform.forward * 0.05f);
     }
     else
     {
         offset = transform.position + (transform.forward * 0.05f);
     }
     float currentDot;
     Vector3 currentLocation = Vector3.zero;
     if (teleportee.GetComponentInChildren<Camera>() != null)
     {
         currentLocation = teleportee.GetComponentInChildren<Camera>().transform.position;
     }
     else
     {
         currentLocation = teleportee.transform.position;
     }
     currentDot = Vector3.Dot(transform.forward, currentLocation - offset);
     Vector3 oldPos = transform.InverseTransformPoint(currentLocation);
     Vector3 newPos = otherPortal.transform.TransformPoint(oldPos);
     Vector3 newOffset = otherPortal.transform.forward * 0.1f;
     if (mirror)
     {
         newOffset = -newOffset;
     }
     if (actualDot < 0)
     {
         newPos += newOffset;
     }
     else if (actualDot > 0)
     {
         newPos -= newOffset;
     }
     else if (actualDot == 0)
     {
         if (currentDot > 0)
         {
             newPos += newOffset;
         }
         else if (currentDot < 0)
         {
             newPos -= newOffset;
         }
     }
     if (teleportee.GetComponentInChildren<Camera>() != null)
     {
         newPos += (teleportee.transform.position - teleportee.GetComponentInChildren<Camera>().transform.position);
     }
     if (mirror)
     {
         teleportee.GetComponent<Rigidbody>().velocity = Vector3.Reflect(teleportee.GetComponent<Rigidbody>().velocity, transform.forward);
         teleportee.transform.rotation = Quaternion.LookRotation(Vector3.Reflect(teleportee.transform.forward, transform.forward), teleportee.transform.up);
     }
     if (teleportee.GetComponentInChildren<RigidbodyFirstPersonController>())
     {
         RigidbodyFirstPersonController person = teleportee.GetComponentInChildren<RigidbodyFirstPersonController>();
         person.dimension = !person.dimension;
         if (mirror)
         {
             person.movementSettings.CurrentTargetSpeed = -person.movementSettings.CurrentTargetSpeed;
         }
     }
     teleportee.transform.position = newPos;
 }
 void Awake()
 {
     rigidbody    = GetComponent <Rigidbody> ();
     rigidbodyFPC = GetComponent <RigidbodyFirstPersonController> ();
     headBob      = GetComponentInChildren <HeadBob> ();
 }
Example #9
0
 void Start()
 {
     rb         = GetComponent <Rigidbody>();
     moveScript = GetComponent <RigidbodyFirstPersonController>();
 }
Example #10
0
    public void EnableRocketJump(float force)
    {
        RigidbodyFirstPersonController fps = Reference.Instance().FPS.GetComponent <RigidbodyFirstPersonController>();

        fps.movementSettings.JumpForce = force;
    }
Example #11
0
 void Start()
 {
     anim          = model.GetComponent <Animator>();
     fp_controller = GetComponent <RigidbodyFirstPersonController>();
 }
 void Start()
 {
     Rbody = GetComponent <Rigidbody> ();
     FPScontroller = GetComponent<RigidbodyFirstPersonController> ();
     mouseLookComponent = GetComponent<RigidbodyFirstPersonController> ().GetComponent<MouseLook>();
 }
Example #13
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.Find("Player").GetComponent <RigidbodyFirstPersonController> ();

        endCanvas = GameObject.Find("EndCanvas");
    }
Example #14
0
 private void Awake()
 {
     audioSource = GetComponent <AudioSource>();
     rigidbodyFirstPersonController = FindObjectOfType <RigidbodyFirstPersonController>();
 }
Example #15
0
 void Start()
 {
     _firstPersonController = GetComponent <RigidbodyFirstPersonController>();
 }
 public void Start()
 {
     playerScript = playerObject.GetComponent <RigidbodyFirstPersonController>();
 }
Example #17
0
 //COMPONENT CONECTION
 private void Start()
 {
     fpCamera   = Camera.main;
     fpsControl = GetComponent <RigidbodyFirstPersonController>();
 }
 // Use this for initialization
 void Start()
 {
     // set controller
     this.controller = GetComponent<RigidbodyFirstPersonController>();
 }
Example #19
0
 private void Awake()
 {
     deathCanvas.enabled = false;
     controller          = GetComponent <RigidbodyFirstPersonController>();
 }
Example #20
0
 public void SetPlayerRigidbody(RigidbodyFirstPersonController _playerRigidbody)
 {
     playerRigidbody = _playerRigidbody;
 }
        public void StartArcade(ArcadeConfiguration arcadeConfiguration, GameObject selectedArcadeModel)
        {
            Debug.Log("Loading Arcade Configuration " + arcadeConfiguration.id + " in ArcadeType " + arcadeConfiguration.arcadeType);
            if (arcadeConfiguration.arcadeType == ArcadeType.FpsArcade.ToString() || arcadeConfiguration.arcadeType == ArcadeType.CylArcade.ToString())
            {
                ArcadeManager.arcadeState = ArcadeStates.LoadingArcade;
            }

            // We are loading stuff...dont do these
            RigidbodyFirstPersonController arcadeRigidbodyFirstPersonController = ArcadeManager.arcadeControls[ArcadeType.FpsArcade].GetComponent <RigidbodyFirstPersonController>();

            if (arcadeRigidbodyFirstPersonController != null)
            {
                arcadeRigidbodyFirstPersonController.pause = true;
            }
            RigidbodyFirstPersonController menuRigidbodyFirstPersonController = ArcadeManager.arcadeControls[ArcadeType.FpsMenu].GetComponent <RigidbodyFirstPersonController>();

            if (menuRigidbodyFirstPersonController != null)
            {
                menuRigidbodyFirstPersonController.pause = true;
            }
            Rigidbody arcadeCameraRigidBody = ArcadeManager.arcadeControls[ArcadeType.FpsArcade].GetComponent <Rigidbody>();

            if (arcadeCameraRigidBody != null)
            {
                arcadeCameraRigidBody.isKinematic = true;
            }
            Rigidbody menuCameraRigidBody = ArcadeManager.arcadeControls[ArcadeType.FpsMenu].GetComponent <Rigidbody>();

            if (menuCameraRigidBody != null)
            {
                menuCameraRigidBody.isKinematic = true;
            }
            CapsuleCollider arcadeCapsuleCollider = ArcadeManager.arcadeControls[ArcadeType.FpsArcade].GetComponent <CapsuleCollider>();

            if (arcadeCapsuleCollider != null)
            {
                arcadeCapsuleCollider.enabled = false;
            }
            CapsuleCollider menuCapsuleCollider = ArcadeManager.arcadeControls[ArcadeType.FpsMenu].GetComponent <CapsuleCollider>();

            if (menuCapsuleCollider != null)
            {
                menuCapsuleCollider.enabled = false;
            }

            // Arcade
            if (arcadeConfiguration.arcadeType == ArcadeType.FpsArcade.ToString() || arcadeConfiguration.arcadeType == ArcadeType.CylArcade.ToString())
            {
                ArcadeManager.activeArcadeType = ArcadeType.None;
                ResetArcade(); // Reset current state to zero

                if (LoadArcade(arcadeConfiguration))
                {
                    UpdateController(ArcadeManager.activeArcadeType);
                    TriggerManager.SendEvent(Event.ArcadeStarted);
                    if (ArcadeManager.arcadeHistory.Count == 1)
                    {
                        TriggerManager.SendEvent(Event.MainMenuStarted);
                    }
                    if (ArcadeManager.activeArcadeType == ArcadeType.FpsArcade)
                    {
                        arcadeCameraRigidBody.isKinematic          = false;
                        arcadeCapsuleCollider.enabled              = true;
                        arcadeRigidbodyFirstPersonController.pause = false;
                    }
                    ArcadeManager.arcadeState = ArcadeStates.Running;
                    Cursor.lockState          = CursorLockMode.Locked;
                    Cursor.visible            = false;
                }
                else
                {
                    Debug.Log("Loading the Arcade Configuration of type " + arcadeConfiguration.arcadeType + " Failed!");
                    // TODO: Show an error dialog!
                }
            }
            // Menu
            if (arcadeConfiguration.arcadeType == ArcadeType.CylMenu.ToString() || arcadeConfiguration.arcadeType == ArcadeType.FpsMenu.ToString())
            {
                ArcadeManager.activeMenuType = ArcadeType.None;
                ResetMenu();

                if (LoadArcade(arcadeConfiguration))
                {
                    UpdateController(Application.isPlaying ? ArcadeManager.activeMenuType : ArcadeManager.activeArcadeType);
                    GameObject obj = ArcadeStateManager.selectedModel;
                    if (obj != null && obj.transform.childCount > 1)
                    {
                        ModelVideoSetup modelVideoSetup = obj.transform.GetChild(1).GetComponent <ModelVideoSetup>();
                        if (modelVideoSetup != null)
                        {
                            modelVideoSetup.ReleasePlayer();
                        }
                        ModelImageSetup modelImageSetup = obj.transform.GetChild(1).GetComponent <ModelImageSetup>();
                        if (modelImageSetup != null)
                        {
                            if (arcadeConfiguration.cylArcadeProperties.Count > 0)
                            {
                                if (arcadeConfiguration.cylArcadeProperties[0].cylArcadeOnScreenSelectedModel)
                                {
                                    modelImageSetup.SetMenuTexture();
                                }
                            }
                        }
                        ArcadeStateManager.savedArcadeModel      = ArcadeStateManager.selectedModel;
                        ArcadeStateManager.savedArcadeModelSetup = ArcadeStateManager.selectedModelSetup;
                    }
                    if (ArcadeManager.activeArcadeType == ArcadeType.FpsMenu)
                    {
                        arcadeCameraRigidBody.isKinematic          = false;
                        arcadeCapsuleCollider.enabled              = true;
                        arcadeRigidbodyFirstPersonController.pause = false;
                    }
                    ArcadeManager.activeMenuType = ArcadeType.CylMenu;
                    ArcadeManager.arcadeState    = ArcadeStates.ArcadeMenu;
                    TriggerManager.SendEvent(Event.MenuStarted);
                    Cursor.lockState = CursorLockMode.Locked;
                    Cursor.visible   = false;
                    return;
                }
                else
                {
                    Debug.Log("Loading the Arcade Configuration of type " + arcadeConfiguration.arcadeType + " Failed!");
                    // TODO: Show an error dialog!
                    ArcadeManager.activeMenuType = ArcadeType.None;
                }
                // If the menu setup fails go back to the regular arcade.
                ArcadeManager.arcadeState = ArcadeStates.Running;
                return;
            }

            void UpdateController(ArcadeType arcadeType)
            {
                ArcadeManager.arcadeControls[arcadeType].transform.position      = arcadeConfiguration.camera.position;
                ArcadeManager.arcadeControls[arcadeType].transform.rotation      = Quaternion.identity;
                ArcadeManager.arcadeControls[arcadeType].transform.localRotation = Quaternion.identity;
                ArcadeManager.arcadeControls[arcadeType].transform.GetChild(0).transform.rotation      = Quaternion.identity;
                ArcadeManager.arcadeControls[arcadeType].transform.GetChild(0).transform.localRotation = arcadeConfiguration.camera.rotation;
                ArcadeManager.arcadeControls[arcadeType].transform.GetChild(0).transform.position      = Vector3.zero;
                ArcadeManager.arcadeControls[arcadeType].transform.GetChild(0).transform.localPosition = new Vector3(0, arcadeConfiguration.camera.height, 0);
                RigidbodyFirstPersonController rigidbodyFirstPersonController = ArcadeManager.arcadeControls[arcadeType].GetComponent <RigidbodyFirstPersonController>();

                if (rigidbodyFirstPersonController != null)
                {
                    rigidbodyFirstPersonController.Setup();
                }
                ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].orthographic           = arcadeConfiguration.camera.orthographic;
                ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].fieldOfView            = arcadeConfiguration.camera.fieldOfView;
                ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].nearClipPlane          = arcadeConfiguration.camera.nearClipPlane;
                ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].farClipPlane           = arcadeConfiguration.camera.farClipPlane;
                ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].rect                   = arcadeConfiguration.camera.viewportRect;
                ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].allowDynamicResolution = arcadeConfiguration.camera.allowDynamicResolution;
                if (arcadeConfiguration.camera.aspectRatio != 0)
                {
                    ArcadeManager.arcadeCameras[ArcadeType.FpsArcade].aspect = arcadeConfiguration.camera.aspectRatio;
                }
            }
        }
Example #22
0
 void Start()
 {
     audio = GetComponent <AudioSource>();
     flashImage.enabled    = false;
     firstPersonController = FindObjectOfType <RigidbodyFirstPersonController>();
 }
Example #23
0
 // Use this for initialization
 void Awake()
 {
     FPSController = GetComponent<RigidbodyFirstPersonController> ();
     Rbody =  GetComponent <Rigidbody> ();
     audioSound = GetComponent<AudioSource> ();
 }
Example #24
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <RigidbodyFirstPersonController>();
     //soundtrack.Play ();
     //player.transform.position = new Vector3(0, 0, 0);
 }
Example #25
0
 void Start()
 {
     playerHealth            = GetComponent <Health> ();
     rbFirstPresonController = GetComponent <RigidbodyFirstPersonController> ();
 }
Example #26
0
 void Start()
 {
     // Get the FirstPersonController script.
     controller   = this.GetComponent <RigidbodyFirstPersonController>();
     changebullet = GetComponent <shooting>();
 }
Example #27
0
 private void Start()
 {
     controller   = Player.player.gameObject.GetComponent <RigidbodyFirstPersonController>();
     isHiding     = false;
     playerObject = Player.player.gameObject;
 }
Example #28
0
 private void Start()
 {
     fpsController = GetComponent <RigidbodyFirstPersonController>();
 }
 void Start()
 {
     _animator            = GetComponent <Animator>();
     _rigidBodyController = GetComponent <RigidbodyFirstPersonController>();
     _shootingScript      = GetComponent <Shooting>();
 }
 public void Start()
 {
     playerScript = playerObject.GetComponent <RigidbodyFirstPersonController>();
     timer        = GetComponentInParent <RGGlobalTimer>();
 }
 // Start is called before the first frame update
 void Start()
 {
     fpsController = FindObjectOfType <RigidbodyFirstPersonController>();
 }
Example #32
0
 void Start()
 {
     _view = GameObject.FindGameObjectWithTag("MainCamera").transform;
     if (_view == null)
         _view = transform;
     Inventory = new List<ItemModel> ();
     _fpsController = GetComponent<RigidbodyFirstPersonController> ();
 }
	void Awake()
	{
		rigidbody = GetComponent<Rigidbody> ();
		rigidbodyFPC = GetComponent<RigidbodyFirstPersonController> ();
		headBob = GetComponentInChildren<HeadBob> ();
	}
Example #34
0
 private void Awake()
 {
     items = FindObjectsOfType <Item>();
     rfpc  = GetComponent <RigidbodyFirstPersonController>();
     rb    = GetComponent <Rigidbody>();
 }
 // Start is called before the first frame update
 private void Start()
 {
     // Get prefs stars in currentScene's name
     starsCount = PlayerPrefs.GetInt(PlayerPrefsConstant.StarsTaken + loadLevelManager.LevelName);
     fps        = GetComponent <RigidbodyFirstPersonController>();
 }
Example #36
0
 //I gave the player gameobject a new "layer", layer 8
 //every time she collides, provide this script with the player's script!
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.layer == 8) {
         fpc = col.gameObject.GetComponent<RigidbodyFirstPersonController> ();
     }
 }
Example #37
0
 // Use this for initialization
 void Start()
 {
     m_FirstPersonController = GetComponent <RigidbodyFirstPersonController> ();
     touchingWall            = 0;
 }
 void Start()
 {
     Tap = GameObject.Find("Tap");
     Bucket = GameObject.Find("Drain");
     FPScontroller = GetComponent<RigidbodyFirstPersonController> ();
     miniStartPos = miniJug.transform.position;
     bigStartPos = bigJug.transform.position;
     audioSound = GetComponent<AudioSource> ();
 }
Example #39
0
        public static void LoadGame(ModelSetup game, ModelSetup selected)
        {
            TriggerManager.SendEvent(Event.GameStarted);

            selectedModelSetup = selected; // The model not its dummy node
            gameModelSetup     = game;     // Different from selected when game was choosen in CylMenu or FpsMenu.

            if (gameModelSetup == null)
            {
                UnityEngine.Debug.Log("Launcher: model setup not found");
                return;
            }
            else
            {
                UnityEngine.Debug.Log("Launcher: launching " + gameModelSetup.id);
            }
            if (selectedModelSetup == null)
            {
                UnityEngine.Debug.Log("Launcher: selectedmodel setup not found");
                return;
            }
            else
            {
                UnityEngine.Debug.Log("Launcher: launchingselected " + selectedModelSetup.id);
            }
            List <EmulatorConfiguration> emulatorConfiguration = ArcadeManager.emulatorsConfigurationList.Where(x => x.emulator.id == gameModelSetup.emulator).ToList();

            if (emulatorConfiguration.Count < 1)
            {
                UnityEngine.Debug.Log("Launcher: no emulator configuration found");
                return;
            }
            selectedModelSetup.isPlaying = true;
            var launcherMethod = GameLauncherMethod.None;

            launcherMethod = gameModelSetup.gameLauncherMethod;
            if (launcherMethod == GameLauncherMethod.None)
            {
                System.Enum.TryParse(emulatorConfiguration[0].emulator.gameLauncherMethod, true, out launcherMethod);
            }
            if (launcherMethod == GameLauncherMethod.None)
            {
                System.Enum.TryParse(selectedModelSetup == gameModelSetup ? ArcadeManager.arcadeConfiguration.gameLauncherMethod : ArcadeManager.menuConfiguration.gameLauncherMethod, true, out launcherMethod);
            }
            switch (launcherMethod)
            {
            case GameLauncherMethod.Internal:
                LoadInternalGame(emulatorConfiguration[0].emulator);
                break;

            case GameLauncherMethod.External:
                LoadExternalGame(emulatorConfiguration[0].emulator);
                break;

            case GameLauncherMethod.URL:
                LoadURLGame(emulatorConfiguration[0].emulator);
                break;

            default:
                UnityEngine.Debug.Log("Launcher: no launcher method found");
                break;
            }

            void LoadExternalGame(EmulatorProperties emulator)
            {
                // Application.OpenURL("mameios://");
                // TODO: Damn this works, but ugly! You know better!
                string path       = ArcadeManager.applicationPath;
                string executable = emulator.executable.Trim();
                string extension  = emulator.extension != null?emulator.extension.Trim() : "";

                // TODO: Implement commandline arguments
                //string arguments = emulator.arguments.Trim();
                string options      = emulator.options.TrimStart();
                string emulatorPath = FileManager.CorrectFilePath(emulator.emulatorPath);

                if (emulatorPath != "")
                {
                    emulatorPath = path + emulatorPath;
                }
                string gamePath = FileManager.CorrectFilePath(emulator.gamePath);

                if (gamePath != "")
                {
                    gamePath = path + gamePath;
                }
                string workingDir = FileManager.CorrectFilePath(emulator.workingDir);

                if (workingDir != "")
                {
                    workingDir = path + workingDir;
                }

                ProcessStartInfo startInfo = new ProcessStartInfo();

                startInfo.FileName  = emulatorPath + executable;
                startInfo.Arguments = options + gamePath + gameModelSetup.id.Trim() + extension; // space char after -File
                if (workingDir != "")
                {
                    startInfo.WorkingDirectory = workingDir;
                }
                startInfo.WindowStyle     = ProcessWindowStyle.Hidden;
                startInfo.CreateNoWindow  = true;
                startInfo.UseShellExecute = false;
                bool    started = false;
                Process process = new Process();

                process.StartInfo = startInfo;
                started           = process.Start();
                try
                {
                    int procId = process.Id;
                }
                catch (InvalidOperationException)
                {
                    started = false;
                }
                catch (Exception ex)
                {
                    UnityEngine.Debug.Log("Error: " + ex.Message + "  " + ex.InnerException);
                    started = false;
                }
                if (started)
                {
                    UnityEngine.Debug.Log("game started");
                    ArcadeManager.arcadeState = ArcadeStates.Game;
                }
            }

            void LoadInternalGame(EmulatorProperties emulator)
            {
                UnityEngine.Debug.Log("Launcher: start internal launcher " + selectedModelSetup.transform.gameObject.name);

                GameObject screen = selectedModelSetup.transform.GetChild(0).GetChild(1).gameObject;

                UnityEngine.Debug.Log("selected obj " + selectedModelSetup.name);
                ModelVideoSetup video = screen.GetComponent <ModelVideoSetup>();

                video.ReleasePlayer(false);
                UnityEngine.Debug.Log("selected video " + video);

                RigidbodyFirstPersonController arcadeRigidbodyFirstPersonController = ArcadeManager.arcadeControls[ArcadeType.FpsArcade].GetComponent <RigidbodyFirstPersonController>();

                if (arcadeRigidbodyFirstPersonController != null)
                {
                    arcadeRigidbodyFirstPersonController.pause = true;
                }

                // TODO: Damn this works, but ugly!
                string path       = ArcadeManager.applicationPath;
                string executable = emulator.libretroCore.Trim();
                string extension  = emulator.extension != null?emulator.extension.Trim() : "";

                string arguments    = emulator.arguments.Trim();
                string options      = emulator.options.TrimStart();
                string emulatorPath = FileManager.CorrectFilePath(emulator.emulatorPath);

                if (emulatorPath != "")
                {
                    emulatorPath = Path.Combine(path + emulatorPath);
                }
                string gamePath = FileManager.CorrectFilePath(emulator.gamePath);

                if (gamePath != "")
                {
                    gamePath = Path.Combine(path + gamePath);
                }
                string workingDir = FileManager.CorrectFilePath(emulator.workingDir);

                if (workingDir != "")
                {
                    workingDir = Path.Combine(path + workingDir);
                }

                //UnityEngine.Debug.Log("is path" + gamePath );
                //UnityEngine.Debug.Log("is game" + gameModelSetup.id);
                ModelLibretroGameSetup libretroGame;

                libretroGame = selectedModelSetup.gameObject.GetComponent <ModelLibretroGameSetup>();
                if (libretroGame == null)
                {
                    libretroGame = selectedModelSetup.gameObject.AddComponent <ModelLibretroGameSetup>();
                    modelLibretroGameSetupsList.Add(libretroGame);
                    libretroGame.StartGame(executable, gamePath, gameModelSetup.id);
                }
                else
                {
                    libretroGame.ResumeGame();
                }
                // Increase 1 to support more then one game at once
                if (modelLibretroGameSetupsList.Count > 1)
                {
                    libretroGame = modelLibretroGameSetupsList[0];
                    if (libretroGame != null)
                    {
                        libretroGame.StopGame();
                        modelLibretroGameSetupsList.RemoveAt(0);
                    }
                }
                ArcadeManager.arcadeState = ArcadeStates.Game;
            }

            void LoadURLGame(EmulatorProperties emulator)
            {
                Application.OpenURL(emulator.executable.Trim() + emulator.options.Trim() + gameModelSetup.id.Trim() + emulator.arguments.Trim());
                ArcadeManager.arcadeState = ArcadeStates.Game;
            }
        }