Ejemplo n.º 1
0
    public static void loadScene(string sceneName)
    {
        RCLog.append("-----------------------------***-------------------------------");
        sceneName = sceneName.Replace("\"", "");
        int index = -1;

        UnityEngine.Debug.Log(sceneName);
        string[] gameFiles = FileManager.getAllScenes();
        //foreach (string s in gameFiles) UnityEngine.Debug.Log(s);
        for (int i = 0; i < gameFiles.Length; i++)
        {
            if (gameFiles[i] == sceneName)
            {
                index = i; break;
            }
        }
        if (index < 0)
        {
            return;
        }
        RCLog.append("checkpoint1");
        Data.reset();
        Data.sceneName = sceneName;
        UnityEngine.GameObject loader = UnityEngine.GameObject.Find("Loader");
        UnityEngine.GameObject gui    = new UnityEngine.GameObject("GUI");
        ObjectInterface        oi     = gui.AddComponent <ObjectInterface>();

        FileManager.loadScene();
        UnityEngine.GameObject.Destroy(gui);
        RCLog.append("checkpoint2");
        loader.GetComponent <Loader>().reload();
        RCLog.append("checkpoint3");
    }
Ejemplo n.º 2
0
 void editorLaunch()
 {
     Data.loadScene(initialScene);
     RCLog.append("checkpoint4");
     unload();
     RCLog.append("checkpoint5");
     SceneManager.LoadScene("editor");
     RCLog.append("checkpoint6");
 }
Ejemplo n.º 3
0
    void resetSpawnPoint(int index)
    {
        spawnObj = Data.objects[index];
        string code = null;

        if (code == null)
        {
            code = spawnObj.GetComponent <MainObject>().script;
        }

        Compiler.setCode(code);
        Compiler.compile();

        Interpretor _ip = new Interpretor();

        _ip.setICode(Compiler.getICode());
        _ip.init();
        string[] ins = _ip.nextIns();
        while ((ins) != null && ins[0] != Compiler.EOP)
        {
            if (ins[0] == "movement")
            {
                if (ins[1].Replace("\"", "") == "false")
                {
                    Data.movementFlag = false;
                }
            }
            ins = _ip.nextIns();
            RCLog.append(ins[0]);
        }
        Vector3 distAboveGround = new Vector3(0, 3, 0);

        if (Data.vrEnabled)
        {
            VRPlayer.transform.position = spawnObj.transform.position + distAboveGround;
        }
        else
        {
            player.transform.position = spawnObj.transform.position + distAboveGround;
        }
        spawnObj.SetActive(false);
    }