Ejemplo n.º 1
0
        public Level(string name, ArxLevelNative arxLevelNative)
        {
            Name           = name;
            ArxLevelNative = arxLevelNative;

            LevelObject     = new GameObject(name);
            LevelMeshObject = new GameObject(name + "Mesh");
            LevelMeshObject.AddComponent <EditableLevelMesh>();
            LevelMeshObject.transform.SetParent(LevelObject.transform);
            LevelObject.transform.localScale = new Vector3(0.01f, -0.01f, 0.01f); //1 unit is 1 cm in arx, so scale down so one unit is one meter (at least perceived)
        }
Ejemplo n.º 2
0
        public static Level LoadLevel(string name)
        {
            var lvln = new ArxLevelNative();

            lvln.LoadLevel(name);

            Level lvl = new Level(name, lvln);

            Vector3 camPos = lvln.DLF.header.positionEdit.ToVector3() / 100;

            camPos.y *= -1;
            LevelEditor.EditorCamera.transform.position    = camPos;
            LevelEditor.EditorCamera.transform.eulerAngles = lvln.DLF.header.angleEdit.ToEuler();
            lvl.LevelOffset = lvln.DLF.header.offset.ToVector3();

            LoadMesh(lvl);

            return(lvl);
        }