public void OnEnable()
    {
        activeInstances.Add( this );

        // Mouse input will be handled by a MouseInputManager instance to
        // consolidate the complexity of mouse operations
        mouseHandler = new MouseInputManager();

        if( useTouch )
        {
            // Multi-touch input will be handled by a TouchInputHandler instance
            // to localize code complexity
            touchHandler = new TouchInputManager( this );
        }

        // If an input adapter has not already been assigned, look for
        // a replacement or assign the default
        if( this.adapter == null )
        {

            // Look for a replacement IInputAdapter component
            var inputAdapter =
                GetComponents( typeof( MonoBehaviour ) )
                .Where( c => c != null && c.GetType() != null && typeof( IInputAdapter ).IsAssignableFrom( c.GetType() ) )
                .FirstOrDefault();

            // Use the replacement if found, otherwise use the default adapter
            this.adapter = (IInputAdapter)inputAdapter ?? new DefaultInput();

        }

        Input.simulateMouseWithTouches = !this.useTouch;
    }
    void Awake()
    {
        networkView = GetComponent<NetworkView>();
        cam = GameObject.Find("Camera");
        mngr = cam.GetComponent<MouseInputManager>();
        if (server){
            LaunchServer();
            mngr.enabled = false;
            StartCoroutine(checkPlayers());
        }else{
            ConnectServer();
        }
        if (Application.loadedLevelName == "MainMenu" || Application.loadedLevelName == "Options" || Application.loadedLevelName == "PlanetSelector" || Application.loadedLevelName == "ProfileSelector")
        {
            isMenu = true;
        }
        entities = new Dictionary<Vector3Int, GameEntity> (new Vector3EqualityComparer ());
        sensorSpaces = new Dictionary<Vector3Int, List<BasicSensor>> (new Vector3EqualityComparer ());
        images[0] = Resources.Load("Art/Textures/GUI/button_exit") as Texture2D;
        images[1] = Resources.Load("Art/Textures/GUI/button_hint") as Texture2D;
        images[2] = Resources.Load("Art/Textures/GUI/button_restart") as Texture2D;
        skin = Resources.Load("Art/Textures/GUI/ingame_skin") as GUISkin;
        foreach (GameObject go in FindObjectsOfType(typeof(GameObject))){
            if (go.name == "Camera"){
                CameraDecubeLevel c = go.GetComponent<CameraDecubeLevel>();
                levelCamera = c;
                break;
            }
        }
        hints = new List<string>();
        path = "Assets/Resources/Txt/hints.txt";
        try{
            tr = new StreamReader(path);
            string temp;
            while((temp = tr.ReadLine()) != null)
            {
                if(hints.Count == 12){
                    hints.Add(temp);
                }
                hints.Add(temp);
            }

            // Close the stream
            tr.Close();
        }
        catch(FileLoadException e) {
            Debug.LogException(e);
        }
    }