예제 #1
0
    void Start()
    {
        if (Game.GameToLoad != "")
        {
            gameName    = Game.GameToLoad;
            gamePath    = ResourceManager.Instance.getCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + "Games" + System.IO.Path.DirectorySeparatorChar;
            useSystemIO = true;
        }

        selected_path = gamePath + gameName;
        selected_game = selected_path + "/";

        //Controller.getInstance ().init ("Games/Fire.eap");
        List <Incidence> incidences = new List <Incidence>();

        data = new AdventureData();
        AdventureHandler_ adventure = new AdventureHandler_(data);

        switch (getLoadingType())
        {
        case ResourceManager.LoadingType.RESOURCES_LOAD:
            adventure.Parse(gameName + "/descriptor");
            break;

        case ResourceManager.LoadingType.SYSTEM_IO:
            adventure.Parse(selected_game + "descriptor.xml");
            break;
        }


        /*Texture2DHolder holder = new Texture2DHolder (data.getChapters () [0].getScenes () [0].getResources () [0].getAssetPath (Scene.RESOURCE_TYPE_BACKGROUND));
         *
         * if (!holder.Loaded ())
         *      Debug.Log ("no se ha cargado");*/

        if (data.getCursors().Count == 0)
        {
            loadDefaultCursors();
        }

        guiprovider = new GUIProvider(data);

        if (!forceScene)
        {
            renderScene(data.getChapters()[current_chapter].getInitialGeneralScene().getId());
        }
        else
        {
            renderScene(scene_name);
        }

        TimerController.Instance.Timers = getTimers();
        TimerController.Instance.Run();
    }
예제 #2
0
    void Awake()
    {
        Game.instance = this;
        style         = Resources.Load("basic") as GUISkin;
        optionlabel   = new GUIStyle(style.label);

        if (Game.GameToLoad != "")
        {
            gameName    = Game.GameToLoad;
            gamePath    = ResourceManager.Instance.getCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + "Games" + System.IO.Path.DirectorySeparatorChar;
            useSystemIO = true;
        }

        selected_path = gamePath + gameName;
        selected_game = selected_path + "/";

        List <Incidence> incidences = new List <Incidence>();

        AdventureData     data      = new AdventureData();
        AdventureHandler_ adventure = new AdventureHandler_(data);

        switch (getLoadingType())
        {
        case ResourceManager.LoadingType.RESOURCES_LOAD:
            adventure.Parse(gameName + "/descriptor");
            ResourceManager.Instance.Path = gameName;
            break;

        case ResourceManager.LoadingType.SYSTEM_IO:
            adventure.Parse(selected_game + "descriptor.xml");
            ResourceManager.Instance.Path = selected_game;
            break;
        }

        game_state = new GameState(data);
    }
예제 #3
0
        void Awake()
        {
            Game.instance = this;
            //Load tracker data
            SimpleJSON.JSONNode hostfile = new SimpleJSON.JSONClass();
            bool loaded = false;

#if UNITY_WEBPLAYER || UNITY_WEBGL
#elif UNITY_ANDROID || UNITY_IPHONE
#else
            if (useSystemIO)
            {
                if (!System.IO.File.Exists("host.cfg"))
                {
                    hostfile.Add("host", new SimpleJSON.JSONData("http://192.168.175.117:3000/api/proxy/gleaner/collector/"));
                    hostfile.Add("trackingCode", new SimpleJSON.JSONData("57d81d5585b094006eab04d6ndecvjlvjss8aor"));
                    System.IO.File.WriteAllText("host.cfg", hostfile.ToString());
                }
                else
                {
                    hostfile = SimpleJSON.JSON.Parse(System.IO.File.ReadAllText("host.cfg"));
                }
                loaded = true;
            }
#endif
            try
            {
                if (loaded)
                {
                    Tracker.T.host         = hostfile["host"];
                    Tracker.T.trackingCode = hostfile["trackingCode"];
                    //End tracker data loading
                }
            }
            catch { }

            style       = Resources.Load("basic") as GUISkin;
            optionlabel = new GUIStyle(style.label);

            if (Game.GameToLoad != "")
            {
                gameName    = Game.GameToLoad;
                gamePath    = ResourceManager.Instance.getCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + "Games" + System.IO.Path.DirectorySeparatorChar;
                useSystemIO = true;
            }

            if (editor_mode)
            {
                gameName = "CurrentGame";
            }

            selected_path = gamePath + gameName;
            selected_game = selected_path + "/";

            // TODO incidences are unused, why?
            //List<Incidence> incidences = new List<Incidence>();

            AdventureData     data      = new AdventureData();
            AdventureHandler_ adventure = new AdventureHandler_(data);
            switch (getLoadingType())
            {
            case ResourceManager.LoadingType.RESOURCES_LOAD:
                adventure.Parse(gameName + "/descriptor");
                ResourceManager.Instance.Path = gameName;
                break;

            case ResourceManager.LoadingType.SYSTEM_IO:
                adventure.Parse(selected_game + "descriptor.xml");
                ResourceManager.Instance.Path = selected_game;
                break;
            }

            game_state = new GameState(data);
            CompletableController.Instance.setCompletables(GameState.getCompletables());
        }
예제 #4
0
    void Awake()
    {
        Game.instance = this;
        style = Resources.Load("basic") as GUISkin;
        optionlabel = new GUIStyle(style.label);

        if (Game.GameToLoad != "") {
            gameName = Game.GameToLoad;
            gamePath = ResourceManager.Instance.getCurrentDirectory () + System.IO.Path.DirectorySeparatorChar + "Games" + System.IO.Path.DirectorySeparatorChar;
            useSystemIO = true;
        }

        selected_path = gamePath + gameName;
        selected_game = selected_path + "/";

        List<Incidence> incidences = new List<Incidence>();

        AdventureData data = new AdventureData ();
        AdventureHandler_ adventure = new AdventureHandler_ (data);
        switch (getLoadingType ()) {
        case ResourceManager.LoadingType.RESOURCES_LOAD:
            adventure.Parse (gameName + "/descriptor");
            ResourceManager.Instance.Path = gameName;
            break;
        case ResourceManager.LoadingType.SYSTEM_IO:
            adventure.Parse (selected_game + "descriptor.xml");
            ResourceManager.Instance.Path = selected_game;
            break;
        }

        game_state = new GameState(data);
    }