Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7464150fe8 | |||
| 3aa6302f6d | |||
| 046247a1df | |||
| e7e11686f3 | |||
| ef1e01307c | |||
| c7d35c6761 | |||
| ed4751fa71 | |||
| a79e82891d | |||
| f070c32b88 | |||
| 1d6e3e871d | |||
| d295f43506 | |||
| 0cbb5fc447 | |||
| c4a78200d7 | |||
| d99e58b06c | |||
| 4dc21dc9a5 | |||
| 2c3aba3283 | |||
| fef065eddf | |||
| b8b509bbc8 | |||
| 14561de520 | |||
| ca9b633e5c | |||
| 7815b6746d | |||
| 8e31864e66 | |||
| 393f8b1b35 | |||
| 3ced2e4fba | |||
| bf6c94e641 | |||
| f6e13c1e73 | |||
| 3ecd705f81 | |||
| b3d48af966 | |||
| 73321b98cd | |||
| 0b266784fb | |||
| 0fe59fd1e3 | |||
| e5d18b4c30 | |||
| ef7b99d4cf | |||
| 68f88bd24c | |||
| 83ba7539d6 | |||
| 8f450c658f | |||
| 8f08aded00 | |||
| 7272c66c51 | |||
| 86308f5687 | |||
| 2acc894ac2 | |||
| 5319333fb0 | |||
| 38d9f58477 | |||
| 5f6738dcd6 | |||
| 705afcf7d8 | |||
| 4a56f34951 | |||
| 2bd00c9999 | |||
| c02fd0a8ab | |||
| e14c122fd7 | |||
| aa54f06cc2 | |||
| 31eed0bb02 | |||
| 110a1ff190 | |||
| b66935daf5 | |||
| da1ef6bb06 | |||
| 90f7de6454 | |||
| aa573daa1e |
@@ -1,4 +1,6 @@
|
||||
marsxplr_build/
|
||||
ripper_build/
|
||||
editor_build/
|
||||
waf*/
|
||||
.lock-waf*
|
||||
.DS_Store
|
||||
|
||||
@@ -272,9 +272,8 @@ public class SeaShader : MonoBehaviour
|
||||
// old cards to make water texture scroll.
|
||||
void Update()
|
||||
{
|
||||
|
||||
Camera cam = Camera.main;
|
||||
if (!cam)
|
||||
if (!cam || !WaterTransform)
|
||||
return;
|
||||
|
||||
//Flip upsidedown if cam is below us
|
||||
|
||||
@@ -12,12 +12,13 @@ public class FloorController : MonoBehaviour
|
||||
if (
|
||||
!whirldObject ||
|
||||
whirldObject.parameters["Texture"] == null ||
|
||||
whirldObject.parameters["Texture"] as Texture == null ||
|
||||
!floorObject
|
||||
)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
floorObject.renderer.material.mainTexture = (Texture)whirldObject.parameters["Texture"];
|
||||
floorObject.renderer.material.mainTexture = (Texture)(whirldObject.parameters["Texture"]);
|
||||
}
|
||||
}
|
||||
@@ -1497,9 +1497,18 @@ public class Game : MonoBehaviour
|
||||
|
||||
GUILayout.Space(20f);
|
||||
|
||||
serverHidden = GUILayout.Toggle(
|
||||
if (
|
||||
WorldDesc.url.Length >= 7 &&
|
||||
WorldDesc.url.Substring(0, 7) == "file://")
|
||||
{
|
||||
serverHidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
serverHidden = GUILayout.Toggle(
|
||||
serverHidden,
|
||||
"Hide This Game From List");
|
||||
}
|
||||
if(!serverHidden)
|
||||
{
|
||||
bool usePass = GUILayout.Toggle(
|
||||
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
public class GameData : MonoBehaviour
|
||||
{
|
||||
//public static float gameVersion = 4.0f;
|
||||
public static SemVer gameVersion = new SemVer("4.0.1");
|
||||
public static SemVer gameVersion = new SemVer("4.0.3");
|
||||
public static float serverVersion = 0.2f;
|
||||
public static string gameName = "marsxplr";
|
||||
public static string userName = "";
|
||||
|
||||
@@ -1141,7 +1141,6 @@ public class WhirldIn : System.Object
|
||||
public IEnumerator LoadSkybox(string v)
|
||||
{
|
||||
String[] vS = v.Split(","[0]);
|
||||
|
||||
//Multiple Image Skybox
|
||||
if (vS.Length > 5)
|
||||
{
|
||||
@@ -1187,7 +1186,11 @@ public class WhirldIn : System.Object
|
||||
{
|
||||
//Wait for everything else to load
|
||||
while (threads.Count > 0) yield return null;
|
||||
RenderSettings.skybox = (Material)GetAsset(v); //, Material
|
||||
|
||||
UnityEngine.Object sbasset = GetAsset(v);
|
||||
RenderSettings.skybox = (sbasset as Material) == null ?
|
||||
null :
|
||||
(Material)sbasset;
|
||||
if (!RenderSettings.skybox)
|
||||
{
|
||||
info +=
|
||||
@@ -1231,7 +1234,7 @@ public class WhirldIn : System.Object
|
||||
char s = data[readChr];
|
||||
|
||||
//Ignore spaces
|
||||
if (s == ' ' || s == '\n' || s == '\t') { ; }
|
||||
if (s == ' ' || s == '\n' || s == '\r' || s == '\t') { ; }
|
||||
|
||||
//Name fully read, begin collecting param value(s)
|
||||
else if (s == ':')
|
||||
@@ -1446,6 +1449,7 @@ public class WhirldIn : System.Object
|
||||
(
|
||||
data[readChr] == ' ' ||
|
||||
data[readChr] == '\n' ||
|
||||
data[readChr] == '\r' ||
|
||||
data[readChr] == '\t'))
|
||||
{
|
||||
readChr++;
|
||||
|
||||
@@ -60,6 +60,7 @@ struct MonoRuntime *initMono(const char *execPath)
|
||||
if(!MX_pathExists(monoRtlPath))
|
||||
{
|
||||
errorMessage("failed to locate mono runtime shared library");
|
||||
printf("libpath: %s\n", monoRtlPath);
|
||||
free(monoRtlPath);
|
||||
|
||||
return NULL;
|
||||
@@ -148,7 +149,7 @@ int main(int argc, char **argv)
|
||||
free(outputLogPath);
|
||||
|
||||
char *uniDomLoaPath = MX_pathConcat(execPath, "Mars Explorer_Data", "lib", "UnityDomainLoad.exe");
|
||||
MonoDomain* domain = mono->jit_init_version(uniDomLoaPath, "v4.0");
|
||||
MonoDomain *domain = (MonoDomain *)mono->jit_init_version(uniDomLoaPath, "v4.0");
|
||||
if(domain == NULL)
|
||||
{
|
||||
MX_LOG_ERROR(OL, "failed to init mono jit on UnityDomainLoad.exe");
|
||||
@@ -163,7 +164,7 @@ int main(int argc, char **argv)
|
||||
"UnityEngine.UnityDomainLoad::RegisterDomainAndLoadAssemblies",
|
||||
(const void *)RegisterDomainAndLoadAssemblies);
|
||||
|
||||
MonoAssembly *assembly = mono->domain_assembly_open(domain, uniDomLoaPath);
|
||||
MonoAssembly *assembly = (MonoAssembly *)mono->domain_assembly_open(domain, uniDomLoaPath);
|
||||
free(uniDomLoaPath);
|
||||
if(assembly == NULL)
|
||||
{
|
||||
|
||||
@@ -9,35 +9,52 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
typedef HMODULE MX_MODULE;
|
||||
typedef FARPROC MX_PTR;
|
||||
#else
|
||||
typedef void * MX_MODULE;
|
||||
typedef void *(*MX_PTR)();
|
||||
#endif
|
||||
|
||||
/// leading "mono_" stripped from names so calling mono functions is like this for example:
|
||||
/// mono->config_parse(NULL);
|
||||
struct MonoRuntime
|
||||
{
|
||||
void *handle;
|
||||
MX_MODULE handle;
|
||||
|
||||
// void mono_set_assemblies_path(const char *assembly_dir)
|
||||
void (*set_assemblies_path)(const char *);
|
||||
//void (*set_assemblies_path)(const char *);
|
||||
MX_PTR set_assemblies_path;
|
||||
|
||||
/// void mono_set_dirs(const char *assembly_dir, const char *config_dir)
|
||||
void (*set_dirs)(const char *, const char *);
|
||||
//void (*set_dirs)(const char *, const char *);
|
||||
MX_PTR set_dirs;
|
||||
|
||||
/// void mono_config_parse (const char *filename)
|
||||
void (*config_parse)(const char *);
|
||||
//void (*config_parse)(const char *);
|
||||
MX_PTR config_parse;
|
||||
|
||||
/// MonoDomain *mono_jit_init_version(const char *root_domain_name, const char *runtime_version)
|
||||
MonoDomain *(*jit_init_version)(const char *, const char *);
|
||||
//MonoDomain *(*jit_init_version)(const char *, const char *);
|
||||
MX_PTR jit_init_version;
|
||||
|
||||
/// void mono_add_internal_call(const char *name, const void* method);
|
||||
void (*add_internal_call)(const char *, const void *);
|
||||
//void (*add_internal_call)(const char *, const void *);
|
||||
MX_PTR add_internal_call;
|
||||
|
||||
/// MonoAssembly *mono_domain_assembly_open(MonoDomain *domain, const char *name)
|
||||
MonoAssembly *(*domain_assembly_open)(MonoDomain *, const char *);
|
||||
//MonoAssembly *(*domain_assembly_open)(MonoDomain *, const char *);
|
||||
MX_PTR domain_assembly_open;
|
||||
|
||||
/// void mono_jit_cleanup(MonoDomain *domain)
|
||||
void (*jit_cleanup)(MonoDomain *);
|
||||
//void (*jit_cleanup)(MonoDomain *);
|
||||
MX_PTR jit_cleanup;
|
||||
|
||||
/// void mono_jit_exec(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
|
||||
void (*jit_exec)(MonoDomain *, MonoAssembly *, int, char *[]);
|
||||
//void (*jit_exec)(MonoDomain *, MonoAssembly *, int, char *[]);
|
||||
MX_PTR jit_exec;
|
||||
};
|
||||
|
||||
struct MonoRuntime *MX_monoRuntimeCreate(char *monoLibPath);
|
||||
|
||||
+2
-2
@@ -9,14 +9,14 @@ def options(opt):
|
||||
opt.add_option('--release_profile',
|
||||
action='store',
|
||||
default='no',
|
||||
help='specify this as \"yes\" or \"no\" to make a release build instead of a debug build which is the default')
|
||||
help='specify this as \"yes\" to make a release build instead of a debug build which is the default')
|
||||
|
||||
def configure(conf):
|
||||
conf.load('compiler_c')
|
||||
conf.env.MONOINC = os.path.join(conf.env.MONO_HOME, 'include', 'mono-2.0')
|
||||
conf.env.RELEASE_PROFILE = conf.options.release_profile
|
||||
if conf.env.RELEASE_PROFILE == 'yes':
|
||||
print('you are configured to build a release profile')
|
||||
print('TAKE NOTE: you are configured to build a release profile')
|
||||
|
||||
def post(bld):
|
||||
ext = '.exe' if os.name == 'nt' else ''
|
||||
|
||||
@@ -4,8 +4,10 @@ My amatuer attempt at decompiling Mars Explorer so that it can be improved to ru
|
||||
<hr>
|
||||
<h1>building</h1>
|
||||
Pretty much all of the game in terms of functionality has compilable source now, but the runtime code is still a work in progress.<br>
|
||||
Building the project requires the mono mcs compiler and libraries, a c compiler, and python.<br>
|
||||
Building the project requires the mono mcs compiler and libraries, a c compiler*, and python.<br>
|
||||
1. configure the project: <pre>python waf configure [--mono_home=...]</pre>
|
||||
2. build the project: <pre>python waf build</pre>
|
||||
If the build is successful, you should be able to find a bunch of dlls in the directory Game\marsxplr_build\Mars Explorer_Data.<br>
|
||||
If the build is successful, you should be able to find a bunch of dlls in the directory marsxplr_build\Mars Explorer_Data.<br>
|
||||
To test the build, can copy the contents of the built Mars Explorer_Data dir into the Mars Explorer_Data dir of your own personal Mars Explorer install in place of the original files.<br>
|
||||
<br>
|
||||
*: c compiler is only required if you intend to build with the option --self_hosted=yes<br>
|
||||
|
||||
+14
-3
@@ -4,11 +4,22 @@ import os
|
||||
import shutil
|
||||
|
||||
def post(bld):
|
||||
distdir = os.path.join(bld.top_dir, 'marsxplr_build', 'Mars Explorer_Data', 'lib')
|
||||
os.makedirs(distdir, exist_ok=True)
|
||||
distdir_m = os.path.join(bld.top_dir, 'marsxplr_build', 'Mars Explorer_Data', 'lib')
|
||||
os.makedirs(distdir_m, exist_ok=True)
|
||||
shutil.copy(
|
||||
os.path.join(bld.out_dir, 'UnityEngine', 'UnityEngine.dll'),
|
||||
os.path.join(distdir, 'UnityEngine.dll'))
|
||||
os.path.join(distdir_m, 'UnityEngine.dll'))
|
||||
distdir_r = os.path.join(bld.top_dir, 'ripper_build', 'Mars Explorer_Data', 'lib')
|
||||
os.makedirs(distdir_r, exist_ok=True)
|
||||
shutil.copy(
|
||||
os.path.join(bld.out_dir, 'UnityEngine', 'UnityEngine.dll'),
|
||||
os.path.join(distdir_r, 'UnityEngine.dll'))
|
||||
distdir_e = os.path.join(bld.top_dir, 'editor_build', 'Mars Explorer_Data', 'lib')
|
||||
os.makedirs(distdir_e, exist_ok=True)
|
||||
shutil.copy(
|
||||
os.path.join(bld.out_dir, 'UnityEngine', 'UnityEngine.dll'),
|
||||
os.path.join(distdir_e, 'UnityEngine.dll'))
|
||||
|
||||
|
||||
def build(bld):
|
||||
bld.add_post_fun(post)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
== THE BIG BOOK OF EDITOR KEYBINDS ==
|
||||
|
||||
W in moveCam mode: move forward
|
||||
|
||||
A moveCam: strafe left
|
||||
|
||||
S moveCam: move backward
|
||||
|
||||
D moveCam: strafe right
|
||||
|
||||
Shift moveCam: move down
|
||||
|
||||
Space moveCam: move up
|
||||
|
||||
Ctrl moveCam: move faster
|
||||
|
||||
V enable/disable moveCam
|
||||
|
||||
Ctrl-N new whirld
|
||||
|
||||
Ctrl-O open whirld
|
||||
|
||||
Ctrl-Q quit editor
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
[Serializable]
|
||||
public class CameraVehicle : MonoBehaviour
|
||||
{
|
||||
public float sensitivityX = 45F;
|
||||
public float sensitivityY = 45F;
|
||||
|
||||
public float minimumX = -360F;
|
||||
public float maximumX = 360F;
|
||||
|
||||
public float minimumY = -90F;
|
||||
public float maximumY = 90F;
|
||||
|
||||
public float baseMoveSpeed = 0.0625f;
|
||||
public float moveSpeed = 24.0f;
|
||||
|
||||
float rotationX = 0F;
|
||||
float rotationY = 0F;
|
||||
|
||||
Quaternion originalRotation;
|
||||
|
||||
public static bool moveCam = false;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if(Input.GetKeyDown(KeyCode.V) && !Game.textInput)
|
||||
moveCam = !moveCam;
|
||||
|
||||
if(!moveCam)
|
||||
{
|
||||
Screen.lockCursor = false;
|
||||
Screen.showCursor = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Screen.showCursor = false;
|
||||
Screen.lockCursor = true;
|
||||
}
|
||||
|
||||
rotationX += Input.GetAxis("Mouse X") * sensitivityX;
|
||||
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
|
||||
|
||||
rotationX = ClampAngle(rotationX, minimumX, maximumX);
|
||||
rotationY = ClampAngle(rotationY, minimumY, maximumY);
|
||||
|
||||
Quaternion xQuaternion = Quaternion.AngleAxis(rotationX, Vector3.up);
|
||||
Quaternion yQuaternion = Quaternion.AngleAxis(rotationY, Vector3.left);
|
||||
|
||||
transform.localRotation = originalRotation * xQuaternion * yQuaternion;
|
||||
|
||||
if(Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
transform.localEulerAngles = Vector3.zero;
|
||||
transform.position = Vector3.zero;
|
||||
}
|
||||
|
||||
Vector3 pos = transform.position;
|
||||
Vector3 direction = Vector3.zero;
|
||||
if(Input.GetKey(KeyCode.W))
|
||||
{
|
||||
direction += Vector3.forward;
|
||||
}
|
||||
if(Input.GetKey(KeyCode.S))
|
||||
{
|
||||
direction -= Vector3.forward;
|
||||
}
|
||||
if(Input.GetKey(KeyCode.D))
|
||||
{
|
||||
direction += Vector3.right;
|
||||
}
|
||||
if(Input.GetKey(KeyCode.A))
|
||||
{
|
||||
direction += Vector3.left;
|
||||
}
|
||||
if(Input.GetKey(KeyCode.Space))
|
||||
{
|
||||
direction += Vector3.up;
|
||||
}
|
||||
if(Input.GetKey(KeyCode.LeftShift))
|
||||
{
|
||||
direction += Vector3.down;
|
||||
}
|
||||
if(Input.GetKey(KeyCode.LeftControl))
|
||||
{
|
||||
direction *= 2;
|
||||
}
|
||||
Quaternion movrot = Quaternion.Euler(0f, transform.localEulerAngles.y, 0f);
|
||||
pos += movrot * direction * moveSpeed * Time.deltaTime;
|
||||
transform.position = pos;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
originalRotation = transform.localRotation;
|
||||
}
|
||||
|
||||
public static float ClampAngle(float angle, float min, float max)
|
||||
{
|
||||
if (angle < -360F)
|
||||
angle += 360F;
|
||||
if (angle > 360F)
|
||||
angle -= 360F;
|
||||
return Mathf.Clamp(angle, min, max);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Game : MonoBehaviour
|
||||
{
|
||||
public GUISkin Skin;
|
||||
float TopElemWidth = Screen.width / 19f;
|
||||
float TopElemHeight = Screen.height / 38;
|
||||
bool fileMenu = false;
|
||||
bool fileOpenMenu = false;
|
||||
string fileOpenUrl = "http://gitea.moe/lamp/whirlds/raw/branch/master/Geiodo/bagels_skate_park.utw";
|
||||
float fileOpenTimeout = 0f;
|
||||
|
||||
public static bool textInput = false;
|
||||
|
||||
public void loadPrefs()
|
||||
{
|
||||
string openWhirldDefault = PlayerPrefs.GetString("openWhirldDefault", "");
|
||||
if(openWhirldDefault != "") fileOpenUrl = openWhirldDefault;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Camera cam = Camera.main;
|
||||
cam.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
|
||||
cam.transform.position = new Vector3(0f, 0f, 0f);
|
||||
foreach (ParticleEmitter pE in UnityEngine.Object.FindObjectsOfType(typeof(ParticleEmitter)))
|
||||
{
|
||||
pE.emit = false;
|
||||
}
|
||||
|
||||
loadPrefs();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if(fileOpenTimeout > 0f)
|
||||
fileOpenTimeout -= Time.deltaTime;
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if(CameraVehicle.moveCam) return;
|
||||
|
||||
if(GUI.Button(
|
||||
new Rect(0, 0, TopElemWidth, TopElemHeight),
|
||||
"File"))
|
||||
{
|
||||
if(fileMenu && !fileOpenMenu)
|
||||
{
|
||||
fileMenu = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
fileMenu = true;
|
||||
}
|
||||
}
|
||||
if(fileMenu)
|
||||
{
|
||||
ShowFileMenu();
|
||||
}
|
||||
|
||||
if(fileOpenMenu)
|
||||
{
|
||||
textInput = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
textInput = false;
|
||||
}
|
||||
|
||||
//handle utility keybinds
|
||||
if(textInput) return;
|
||||
if(Input.GetKey(KeyCode.LeftControl))
|
||||
{
|
||||
if(Input.GetKeyDown(KeyCode.N))
|
||||
{
|
||||
onFileNew();
|
||||
}
|
||||
else if(Input.GetKeyDown(KeyCode.O))
|
||||
{
|
||||
fileMenu = true;
|
||||
fileOpenMenu = true;
|
||||
}
|
||||
else if(Input.GetKeyDown(KeyCode.Q))
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void onFileNew()
|
||||
{
|
||||
if(!GameObject.Find("WhirldBuffer"))
|
||||
WhirldIn.ResetSpace();
|
||||
}
|
||||
|
||||
private void ShowFileMenu()
|
||||
{
|
||||
if(GUI.Button(
|
||||
new Rect(0, TopElemHeight, TopElemWidth, TopElemHeight),
|
||||
"New"))
|
||||
{
|
||||
onFileNew();
|
||||
}
|
||||
|
||||
if(GUI.Button(
|
||||
new Rect(0, TopElemHeight * 2, TopElemWidth, TopElemHeight),
|
||||
"Open"))
|
||||
{
|
||||
fileOpenMenu = !fileOpenMenu;
|
||||
}
|
||||
if(fileOpenMenu)
|
||||
{
|
||||
ShowFileOpenMenu();
|
||||
}
|
||||
|
||||
if(GUI.Button(
|
||||
new Rect(0, TopElemHeight * 3, TopElemWidth, TopElemHeight),
|
||||
"Exit"))
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowFileOpenMenu()
|
||||
{
|
||||
GUI.SetNextControlName("FileOpenTF");
|
||||
fileOpenUrl = GUI.TextField(
|
||||
new Rect(TopElemWidth, TopElemHeight * 2, TopElemWidth * 3, TopElemHeight),
|
||||
fileOpenUrl);
|
||||
GUI.FocusControl("FileOpenTF");
|
||||
if(GUI.Button(
|
||||
new Rect(TopElemWidth * 4, TopElemHeight * 2, TopElemWidth, TopElemHeight),
|
||||
"Submit") ||
|
||||
Input.GetKeyDown(KeyCode.Return))
|
||||
{
|
||||
if(!GameObject.Find("WhirldBuffer") && fileOpenTimeout <= 0)
|
||||
{
|
||||
fileOpenTimeout = 1f;
|
||||
|
||||
WhirldIn wi = new WhirldIn();
|
||||
wi.url = fileOpenUrl;
|
||||
wi.Load();
|
||||
|
||||
fileOpenMenu = false;
|
||||
fileMenu = false;
|
||||
}
|
||||
} else if(Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
fileOpenMenu = false;
|
||||
fileMenu = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Init : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
Screen.fullScreen = false;
|
||||
|
||||
Application.LoadLevel(Application.loadedLevel + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Lobby : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
QualitySettings.currentLevel = QualityLevel.Simple;
|
||||
Screen.lockCursor = false;
|
||||
Application.runInBackground = false;
|
||||
|
||||
Application.LoadLevel(Application.loadedLevel + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class MonoBehaviourScript : MonoBehaviour {
|
||||
public void Start() { }
|
||||
}
|
||||
@@ -0,0 +1,542 @@
|
||||
//********************************************************************************************************************************************
|
||||
//*********************************** Whirld - by Aubrey Falconer ****************************************************************************
|
||||
//**** http://AubreyFalconer.com **** http://web.archive.org/web/20120519040400/http://www.unifycommunity.com/wiki/index.php?title=Whirld ****
|
||||
//********************************************************************************************************************************************
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class BaseSimple : MonoBehaviour {}
|
||||
|
||||
[Serializable]
|
||||
public enum WhirldInStatus
|
||||
{
|
||||
Idle,
|
||||
Working,
|
||||
Success,
|
||||
WWWError,
|
||||
SyntaxError
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class WhirldIn : System.Object
|
||||
{
|
||||
public WhirldInStatus status = WhirldInStatus.Idle;
|
||||
public string statusTxt = "";
|
||||
public float progress = 0.00f;
|
||||
public string info = "";
|
||||
public string url = "";
|
||||
public string data;
|
||||
public GameObject world;
|
||||
public GameObject whirldBuffer;
|
||||
public string worldName = "World";
|
||||
public string urlPath;
|
||||
public Hashtable objects = new Hashtable();
|
||||
public MonoBehaviour monoBehaviour; //Needed for attaching Coroutines too
|
||||
public int readChr = 0;
|
||||
|
||||
public static void ResetSpace()
|
||||
{
|
||||
GameObject wld = GameObject.Find("World");
|
||||
if (wld) GameObject.Destroy(wld);
|
||||
GameObject bse = GameObject.Find("Base");
|
||||
if (bse) GameObject.Destroy(bse);
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
whirldBuffer = new GameObject("WhirldBuffer");
|
||||
monoBehaviour = (MonoBehaviour)whirldBuffer.AddComponent(typeof(MonoBehaviourScript));
|
||||
|
||||
monoBehaviour.StartCoroutine(Generate());
|
||||
}
|
||||
|
||||
public void Cleanup()
|
||||
{
|
||||
//We are still loading the world
|
||||
if ((bool)whirldBuffer && (bool)monoBehaviour)
|
||||
{
|
||||
monoBehaviour.StopAllCoroutines();
|
||||
GameObject.Destroy(whirldBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator Generate()
|
||||
{
|
||||
|
||||
status = WhirldInStatus.Working;
|
||||
|
||||
if (url != "")
|
||||
{
|
||||
|
||||
//Download Whirld File
|
||||
statusTxt = "Downloading World Definition";
|
||||
info = "";
|
||||
urlPath = url.Substring(0, url.LastIndexOf("/") + 1);
|
||||
WWW www = new WWW(url);
|
||||
while (!www.isDone)
|
||||
{
|
||||
progress = www.progress;
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
}
|
||||
progress = 1f;
|
||||
|
||||
//Verify Successful Download
|
||||
if (www.error != null)
|
||||
{
|
||||
info =
|
||||
"Failed to download Whirld definition file: " +
|
||||
url +
|
||||
" (" +
|
||||
www.error +
|
||||
")\n";
|
||||
status = WhirldInStatus.WWWError;
|
||||
yield break;
|
||||
}
|
||||
data = www.data;
|
||||
|
||||
}
|
||||
|
||||
//Init
|
||||
readChr = 0;
|
||||
ResetSpace();
|
||||
world = new GameObject("World");
|
||||
statusTxt = "Parsing World Definition";
|
||||
|
||||
//Sanity Check
|
||||
if (
|
||||
data == null ||
|
||||
data.Length < 10 ||
|
||||
(data[0] != '[' && data[0] != '{'))
|
||||
{
|
||||
status = WhirldInStatus.SyntaxError;
|
||||
yield break;
|
||||
}
|
||||
|
||||
//Read Whirld Headers
|
||||
String n = null;
|
||||
String v = null;
|
||||
while (true)
|
||||
{
|
||||
//Read next char
|
||||
char s = data[readChr];
|
||||
readChr++;
|
||||
|
||||
//Incorrectly nested header []s
|
||||
if (readChr >= data.Length)
|
||||
{
|
||||
status = WhirldInStatus.SyntaxError;
|
||||
yield break;
|
||||
}
|
||||
|
||||
//Ignore Newlines and Tabs
|
||||
else if (s == '\n' || s == '\t') continue;
|
||||
|
||||
else if (s == '{') break; //Finished reading headers
|
||||
else if (s == '[') //Beginning new header
|
||||
{
|
||||
n = "";
|
||||
v = "";
|
||||
}
|
||||
|
||||
//Header name read, read value
|
||||
else if (s == ':' && n == "")
|
||||
{
|
||||
n = v;
|
||||
v = "";
|
||||
}
|
||||
|
||||
//Header ended
|
||||
else if (s == ']')
|
||||
{
|
||||
//[name] header
|
||||
if (n == "")
|
||||
{
|
||||
n = v;
|
||||
v = "";
|
||||
}
|
||||
|
||||
//AssetBundle
|
||||
// if (n == "ab") monoBehaviour.StartCoroutine_Auto(LoadAssetBundle(v));
|
||||
|
||||
//StreamedScene
|
||||
// if (n == "ss") monoBehaviour.StartCoroutine_Auto(LoadStreamedScene(v));
|
||||
|
||||
//Skybox
|
||||
// else if (n == "rndSkybox") monoBehaviour.StartCoroutine_Auto(LoadSkybox(v));
|
||||
|
||||
//Texture
|
||||
// else if (n == "txt") monoBehaviour.StartCoroutine_Auto(LoadTexture(v));
|
||||
|
||||
//Mesh
|
||||
// else if (n == "msh") monoBehaviour.StartCoroutine_Auto(LoadMesh(v));
|
||||
|
||||
//Terrain
|
||||
// else if (n == "trn") monoBehaviour.StartCoroutine_Auto(LoadTerrain(v));
|
||||
|
||||
//Rendering Settings
|
||||
/*else */if (
|
||||
n == "rndFogColor" ||
|
||||
n == "rndFogDensity" ||
|
||||
n == "rndAmbientLight" ||
|
||||
n == "rndHaloStrength" ||
|
||||
n == "rndFlareStrength")
|
||||
{
|
||||
String[] vS = v.Split(","[0]);
|
||||
if (n == "rndFogColor")
|
||||
{
|
||||
RenderSettings.fogColor = new Color(
|
||||
float.Parse(vS[0]),
|
||||
float.Parse(vS[1]),
|
||||
float.Parse(vS[2]),
|
||||
1);
|
||||
}
|
||||
else if (n == "rndFogDensity")
|
||||
{
|
||||
RenderSettings.fogDensity = float.Parse(v);
|
||||
}
|
||||
else if (n == "rndAmbientLight")
|
||||
{
|
||||
RenderSettings.ambientLight = new Color(
|
||||
float.Parse(vS[0]),
|
||||
float.Parse(vS[1]),
|
||||
float.Parse(vS[2]),
|
||||
float.Parse(vS[3]));
|
||||
}
|
||||
else if (n == "rndHaloStrength")
|
||||
{
|
||||
RenderSettings.haloStrength = float.Parse(v);
|
||||
}
|
||||
else if (n == "rndFlareStrength")
|
||||
{
|
||||
RenderSettings.flareStrength = float.Parse(v);
|
||||
}
|
||||
}
|
||||
|
||||
//Arbitrary Data
|
||||
// else worldParams.Add(n, v);
|
||||
|
||||
}
|
||||
|
||||
//Header char read
|
||||
else v += s;
|
||||
}
|
||||
|
||||
statusTxt = "Downloading World Assets";
|
||||
|
||||
//Wait for all "threads" to finish working
|
||||
// while (threads.Count > 0)
|
||||
// {
|
||||
// yield return null;
|
||||
// }
|
||||
|
||||
//Generate World
|
||||
statusTxt = "Initializing World";
|
||||
ReadObject(world.transform);
|
||||
|
||||
//Cleanup
|
||||
GameObject.Destroy(whirldBuffer);
|
||||
|
||||
//Send Scene Generation Notice to each object
|
||||
foreach (GameObject go in GameObject.FindObjectsOfType(typeof(GameObject)))
|
||||
{
|
||||
go.SendMessage(
|
||||
"OnSceneGenerated",
|
||||
SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
|
||||
//Success!
|
||||
status = WhirldInStatus.Success;
|
||||
statusTxt = "World Loaded Successfully";
|
||||
if (info != "")
|
||||
{
|
||||
Debug.Log("Whirld Loading Info: " + info);
|
||||
}
|
||||
|
||||
PlayerPrefs.SetString("openWhirldDefault", url);
|
||||
}
|
||||
|
||||
public void ReadObject(Transform parent)
|
||||
{
|
||||
// /*UNUSED*/ string c = null; //Character
|
||||
int i = 0; //Index of param
|
||||
string n = ""; //Param name we are reading data for
|
||||
string v = ""; //Value we are building
|
||||
List<String> d = new List<String>(); //Array of all values in current param data
|
||||
GameObject obj = null; //Object we have created
|
||||
|
||||
GameObject goP = default(GameObject);
|
||||
Light lightSource = default(Light);
|
||||
while (true)
|
||||
{
|
||||
if (readChr >= data.Length) return;
|
||||
|
||||
//Get Char
|
||||
char s = data[readChr];
|
||||
|
||||
//Ignore spaces
|
||||
if (s == ' ' || s == '\n' || s == '\r' || s == '\t') { ; }
|
||||
|
||||
//Name fully read, begin collecting param value(s)
|
||||
else if (s == ':')
|
||||
{
|
||||
n = v;
|
||||
v = "";
|
||||
}
|
||||
|
||||
//Move to next section of value
|
||||
else if (s == ',')
|
||||
{
|
||||
d.Add(v);
|
||||
v = "";
|
||||
}
|
||||
|
||||
//Move to next section of value
|
||||
else if (s == '{')
|
||||
{
|
||||
readChr++;
|
||||
ReadObject(obj.transform);
|
||||
//Continue to next obj once the child "thread" we just launched has finished parsing objects at it's level
|
||||
continue;
|
||||
}
|
||||
|
||||
//Assign current value to object, Begin reading new value
|
||||
else if (s == ';' || s == '}')
|
||||
{
|
||||
|
||||
//Object name just read, create object
|
||||
if (!obj)
|
||||
{
|
||||
if (objects.ContainsKey(v))
|
||||
{
|
||||
if (objects[v] != null)
|
||||
{
|
||||
goP = (GameObject)objects[v];
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Whirld: Objects[" + v + "] is null");
|
||||
}
|
||||
//else goP = gameObject.Find();
|
||||
}
|
||||
else
|
||||
{
|
||||
goP = (GameObject)Resources.Load(v);
|
||||
if ((bool)goP) objects.Add(v, goP);
|
||||
}
|
||||
if ((bool)goP)
|
||||
{
|
||||
obj = (GameObject)GameObject.Instantiate(goP);
|
||||
obj.name = v;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj = new GameObject(v);
|
||||
objects.Add(v, obj);
|
||||
}
|
||||
if (
|
||||
obj.name != "Base" &&
|
||||
obj.name != "Sea" &&
|
||||
obj.name != "JumpPoint" &&
|
||||
obj.name != "Light")
|
||||
{
|
||||
obj.transform.parent = parent;
|
||||
}
|
||||
lightSource = (Light)obj.GetComponent(typeof(Light));
|
||||
}
|
||||
|
||||
//Object already created, assign property to object
|
||||
else
|
||||
{
|
||||
if (
|
||||
(n == "p" || (n == "" && i == 1)) &&
|
||||
d.Count == 2)
|
||||
{
|
||||
obj.transform.localPosition = new Vector3(
|
||||
float.Parse(d[0]),
|
||||
float.Parse(d[1]),
|
||||
float.Parse(v));
|
||||
}
|
||||
else if (
|
||||
n == "p" ||
|
||||
(n == "" && i == 1))
|
||||
{
|
||||
obj.transform.localPosition = Vector3.one * float.Parse(v);
|
||||
}
|
||||
else if (
|
||||
(n == "r" || (n == string.Empty && i == 2)) &&
|
||||
d.Count == 3)
|
||||
{
|
||||
obj.transform.rotation = new Quaternion(
|
||||
float.Parse(d[0]),
|
||||
float.Parse(d[1]),
|
||||
float.Parse(d[2]),
|
||||
float.Parse(v));
|
||||
}
|
||||
else if (
|
||||
(n == "r" || (n == string.Empty && i == 2)) &&
|
||||
d.Count == 2)
|
||||
{
|
||||
obj.transform.rotation = Quaternion.Euler(
|
||||
float.Parse(d[0]),
|
||||
float.Parse(d[1]),
|
||||
float.Parse(v));
|
||||
}
|
||||
else if (
|
||||
(n == "r" || (n == string.Empty && i == 2)) &&
|
||||
d.Count == 0)
|
||||
{
|
||||
obj.transform.rotation = Quaternion.identity;
|
||||
}
|
||||
else if (
|
||||
(n == "s" || (n == string.Empty && i == 3)) &&
|
||||
d.Count == 0)
|
||||
{
|
||||
obj.transform.localScale = Vector3.one * float.Parse(v);
|
||||
}
|
||||
else if (
|
||||
n == "s" ||
|
||||
(n == "" && i == 3))
|
||||
{
|
||||
obj.transform.localScale = new Vector3(
|
||||
float.Parse(d[0]),
|
||||
float.Parse(d[1]),
|
||||
float.Parse(v));
|
||||
}
|
||||
else if (n == "m")
|
||||
{
|
||||
//d.Add(v);
|
||||
//ReadMesh(obj, d);
|
||||
info += "Inline Whirld mesh generation not supported\n";
|
||||
}
|
||||
else if ((bool)lightSource && n == "color")
|
||||
{
|
||||
Color lsc = lightSource.color;
|
||||
lsc.r = float.Parse(d[0]);
|
||||
lsc.g = float.Parse(d[1]);
|
||||
lsc.b = float.Parse(v);
|
||||
lightSource.color = lsc;
|
||||
}
|
||||
else if ((bool)lightSource && n == "intensity")
|
||||
{
|
||||
lightSource.intensity = float.Parse(v);
|
||||
}
|
||||
else
|
||||
if (n != "")
|
||||
{
|
||||
Debug.Log(
|
||||
obj.name +
|
||||
" Unknown/NotYetImplimented Param: " +
|
||||
n +
|
||||
" > " +
|
||||
v);
|
||||
}
|
||||
}
|
||||
|
||||
//Reset properties
|
||||
v = "";
|
||||
n = "";
|
||||
if (d.Count > 0) d = new List<String>();
|
||||
i++;
|
||||
|
||||
//Done reading this object
|
||||
if (s == '}')
|
||||
{
|
||||
//Finish up this object
|
||||
if (
|
||||
obj.name == "cube" ||
|
||||
obj.name == "pyramid" ||
|
||||
obj.name == "cone" ||
|
||||
obj.name == "mesh")
|
||||
{
|
||||
TextureObject(obj);
|
||||
}
|
||||
|
||||
//Increment ReadChar
|
||||
readChr++;
|
||||
|
||||
//Handle spaces
|
||||
while (
|
||||
readChr < data.Length &&
|
||||
(
|
||||
data[readChr] == ' ' ||
|
||||
data[readChr] == '\n' ||
|
||||
data[readChr] == '\r' ||
|
||||
data[readChr] == '\t'))
|
||||
{
|
||||
readChr++;
|
||||
}
|
||||
|
||||
//Read the next object
|
||||
if (readChr < data.Length && data[readChr] == '{')
|
||||
{
|
||||
readChr++;
|
||||
ReadObject(parent);
|
||||
return;
|
||||
}
|
||||
|
||||
//Done reading objects at this level of recursion
|
||||
else return;
|
||||
}
|
||||
}
|
||||
|
||||
//Assign char to property we are reading
|
||||
else
|
||||
{
|
||||
if (n != null) v += s;
|
||||
else n += s;
|
||||
}
|
||||
readChr++;
|
||||
}
|
||||
}
|
||||
|
||||
public void TextureObject(GameObject go)
|
||||
{
|
||||
MeshFilter mf = (MeshFilter)go.GetComponent(typeof(MeshFilter));
|
||||
if (!mf) return;
|
||||
Mesh mesh = mf.mesh;
|
||||
Vector2[] uvs = new Vector2[mesh.vertices.Length];
|
||||
int[] tris = mesh.triangles;
|
||||
for (int i = 0; i < tris.Length; i += 3)
|
||||
{
|
||||
Vector3 a = go.transform.TransformPoint(mesh.vertices[tris[i]]);
|
||||
Vector3 b = go.transform.TransformPoint(mesh.vertices[tris[i+1]]);
|
||||
Vector3 c = go.transform.TransformPoint(mesh.vertices[tris[i+2]]);
|
||||
Vector3 n = Vector3.Cross(a-c, b-c).normalized;
|
||||
if (
|
||||
Vector3.Dot(Vector3.up, n) >= 0.5f ||
|
||||
(Vector3.Dot(-Vector3.up, n) >= 0.5f))
|
||||
{
|
||||
uvs[tris[i]] = new Vector2(a.x, a.z);
|
||||
uvs[tris[i+1]] = new Vector2(b.x, b.z);
|
||||
uvs[tris[i+2]] = new Vector2(c.x, c.z);
|
||||
}
|
||||
else if (
|
||||
Vector3.Dot(Vector3.right, n) >= 0.5f ||
|
||||
(Vector3.Dot(Vector3.left, n) >= 0.5f))
|
||||
{
|
||||
uvs[tris[i]] = new Vector2(a.y, a.z);
|
||||
uvs[tris[i+1]] = new Vector2(b.y, b.z);
|
||||
uvs[tris[i+2]] = new Vector2(c.y, c.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
uvs[tris[i]] = new Vector2(a.y, a.x);
|
||||
uvs[tris[i + 1]] = new Vector2(b.y, b.x);
|
||||
uvs[tris[i + 2]] = new Vector2(c.y, c.x);
|
||||
}
|
||||
}
|
||||
mesh.uv = uvs;
|
||||
}
|
||||
|
||||
public String GetURL(String url)
|
||||
{
|
||||
if (url.Substring(0, 4) != "http") url = urlPath + url;
|
||||
return url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
## editor
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
def post(bld):
|
||||
distdir = os.path.join(bld.top_dir, 'editor_build', 'Mars Explorer_Data')
|
||||
os.makedirs(distdir, exist_ok=True)
|
||||
shutil.copy(
|
||||
os.path.join(bld.out_dir, 'editor', '58cc2f0ae478d40e7a89c7ba576c3586.dll'),
|
||||
os.path.join(distdir, 'Assembly - UnityScript.dll'))
|
||||
|
||||
def build(bld):
|
||||
bld.add_post_fun(post)
|
||||
|
||||
bld(
|
||||
source=bld.path.ant_glob(os.path.join('src', '*.cs')),
|
||||
target='58cc2f0ae478d40e7a89c7ba576c3586.dll',
|
||||
rule='"${MCS}" -recurse:\"' +
|
||||
os.path.join(bld.path.abspath(), 'src', '*.cs') +
|
||||
'\" -reference:\"' + str(os.path.join(bld.out_dir, 'UnityEngine', 'UnityEngine.dll')) +
|
||||
# '\" -reference:\"' + str(os.path.join(bld.out_dir, 'Assembly_-_CSharp_-_first_pass', '26998b3a9cbf54825a27e5f2d3cc4df1.dll')) +
|
||||
'\" -out:${TGT} -target:library ${MONOOPTS}')
|
||||
@@ -0,0 +1,6 @@
|
||||
- slideshow abt unity 5.x internals
|
||||
https://www.slideshare.net/slideshow/unity-internals-memory-and-performance/35909332
|
||||
- unity pro for ppc machine. perhaps get this running on an old machine or vm and try ripping scenes/assets from it
|
||||
https://www.macintoshrepository.org/15255-unity-pro
|
||||
- info on godot engine architecture:
|
||||
https://docs.godotengine.org/en/4.4/contributing/development/core_and_modules/index.html
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Game : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
LevelInfo.LogToFile();
|
||||
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Init : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
LevelInfo.LogToFile();
|
||||
|
||||
Application.LoadLevel(Application.loadedLevel + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
//TODO: dont display the header of an object type if no objects of that type are found in the scene.
|
||||
|
||||
public class LevelInfo
|
||||
{
|
||||
private static void Discriminate<T>(ref List<T> objs, T heir) where T : UnityEngine.Object
|
||||
{
|
||||
for(int i = objs.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if(objs[i].GetInstanceID() == heir.GetInstanceID())
|
||||
{
|
||||
objs.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct ObjsWithType {
|
||||
public List<UnityEngine.Object> objs;
|
||||
public string type;
|
||||
|
||||
public ObjsWithType(List<UnityEngine.Object> o, string t)
|
||||
{
|
||||
objs = o;
|
||||
type = t;
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogToFile()
|
||||
{
|
||||
string ripLogPath = Path.Combine(
|
||||
Directory.GetParent(Application.dataPath).ToString(),
|
||||
Application.loadedLevelName + "_level" + Application.loadedLevel + "_info.txt");
|
||||
|
||||
List<int> taken = new List<int>();
|
||||
List<ObjsWithType> owts = new List<ObjsWithType>();
|
||||
Type[] types = {
|
||||
// : MonoBehaviour
|
||||
typeof(Terrain),
|
||||
|
||||
// : Renderer
|
||||
typeof(LineRenderer),
|
||||
typeof(MeshRenderer),
|
||||
typeof(ParticleRenderer),
|
||||
typeof(SkinnedMeshRenderer),
|
||||
typeof(TrailRenderer),
|
||||
|
||||
// : GUIElement
|
||||
typeof(GUIText),
|
||||
typeof(GUITexture),
|
||||
|
||||
// : ScriptableObject
|
||||
typeof(GUISkin),
|
||||
typeof(ScriptableShaderPass),
|
||||
|
||||
// : Texture
|
||||
typeof(Cubemap),
|
||||
typeof(MovieTexture),
|
||||
typeof(RenderTexture),
|
||||
typeof(Texture2D),
|
||||
|
||||
// : Joint
|
||||
typeof(CharacterJoint),
|
||||
typeof(ConfigurableJoint),
|
||||
typeof(FixedJoint),
|
||||
typeof(HingeJoint),
|
||||
typeof(SpringJoint),
|
||||
|
||||
// : Collider
|
||||
typeof(BoxCollider),
|
||||
typeof(CapsuleCollider),
|
||||
typeof(CharacterController),
|
||||
typeof(MeshCollider),
|
||||
typeof(RaycastCollider),
|
||||
typeof(SphereCollider),
|
||||
typeof(TerrainCollider),
|
||||
typeof(WheelCollider),
|
||||
|
||||
// : Behaviour
|
||||
typeof(Animation),
|
||||
typeof(AudioListener),
|
||||
typeof(AudioSource),
|
||||
typeof(Camera),
|
||||
typeof(ConstantForce),
|
||||
typeof(GUIElement),
|
||||
typeof(GUILayer),
|
||||
typeof(LensFlare),
|
||||
typeof(Light),
|
||||
typeof(MonoBehaviour),
|
||||
typeof(NetworkView),
|
||||
typeof(Projector),
|
||||
typeof(Skybox),
|
||||
|
||||
// : Component
|
||||
typeof(Behaviour),
|
||||
typeof(Collider),
|
||||
typeof(Joint),
|
||||
typeof(Renderer),
|
||||
typeof(MeshFilter),
|
||||
typeof(ParticleAnimator),
|
||||
typeof(ParticleEmitter),
|
||||
typeof(Rigidbody),
|
||||
typeof(TextMesh),
|
||||
typeof(Transform),
|
||||
|
||||
// : UnityEngine.Object
|
||||
typeof(GameObject),
|
||||
typeof(Component),
|
||||
typeof(AnimationClip),
|
||||
typeof(AssetBundle),
|
||||
typeof(AudioClip),
|
||||
typeof(Texture),
|
||||
typeof(Flare),
|
||||
typeof(Font),
|
||||
typeof(ScriptableObject),
|
||||
typeof(Material),
|
||||
typeof(Mesh),
|
||||
typeof(PhysicMaterial),
|
||||
typeof(Shader),
|
||||
typeof(TerrainData),
|
||||
typeof(TextAsset),
|
||||
|
||||
typeof(UnityEngine.Object),
|
||||
};
|
||||
|
||||
foreach(Type t in types)
|
||||
{
|
||||
owts.Add(new ObjsWithType(
|
||||
new List<UnityEngine.Object>(UnityEngine.Object.FindObjectsOfTypeAll(t)),
|
||||
t.ToString()
|
||||
));
|
||||
if(owts[owts.Count - 1].objs.Count < 1) owts.RemoveAt(owts.Count - 1);
|
||||
}
|
||||
|
||||
using(StreamWriter ripLog = new StreamWriter(ripLogPath, false))
|
||||
{
|
||||
string objformat = "{0,-8} | {1,-32} | {2}";
|
||||
ripLog.WriteLine(objformat,
|
||||
"id", "name", "hideFlags");
|
||||
ripLog.WriteLine();
|
||||
ripLog.WriteLine();
|
||||
|
||||
foreach(ObjsWithType owt in owts)
|
||||
{
|
||||
ripLog.WriteLine("\t-- " + owt.type + " --");
|
||||
|
||||
foreach(UnityEngine.Object o in owt.objs)
|
||||
{
|
||||
if(taken.Contains(o.GetInstanceID())) continue;
|
||||
ripLog.WriteLine(
|
||||
objformat,
|
||||
o.GetInstanceID().ToString(),
|
||||
o.name,
|
||||
o.hideFlags.ToString());
|
||||
|
||||
taken.Add(o.GetInstanceID());
|
||||
}
|
||||
ripLog.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Lobby : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
LevelInfo.LogToFile();
|
||||
|
||||
Application.LoadLevel(Application.loadedLevel + 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
## ripper
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
def post(bld):
|
||||
distdir = os.path.join(bld.top_dir, 'ripper_build', 'Mars Explorer_Data')
|
||||
os.makedirs(distdir, exist_ok=True)
|
||||
shutil.copy(
|
||||
os.path.join(bld.out_dir, 'ripper', '58cc2f0ae478d40e7a89c7ba576c3586.dll'),
|
||||
os.path.join(distdir, 'Assembly - UnityScript.dll'))
|
||||
|
||||
def build(bld):
|
||||
bld.add_post_fun(post)
|
||||
|
||||
bld(
|
||||
source=bld.path.ant_glob(os.path.join('src', '*.cs')),
|
||||
target='58cc2f0ae478d40e7a89c7ba576c3586.dll',
|
||||
rule='"${MCS}" -recurse:\"' +
|
||||
os.path.join(bld.path.abspath(), 'src', '*.cs') +
|
||||
'\" -reference:\"' + str(os.path.join(bld.out_dir, 'UnityEngine', 'UnityEngine.dll')) +
|
||||
# '\" -reference:\"' + str(os.path.join(bld.out_dir, 'Assembly_-_CSharp_-_first_pass', '26998b3a9cbf54825a27e5f2d3cc4df1.dll')) +
|
||||
'\" -out:${TGT} -target:library ${MONOOPTS}')
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
import shutil
|
||||
|
||||
APPNAME = 'MarsXPLR'
|
||||
VERSION = '4.0.1'
|
||||
VERSION = '4.0.3'
|
||||
|
||||
top = '.'
|
||||
out = 'wafbuild'
|
||||
@@ -14,6 +14,10 @@ def options(opt):
|
||||
action='store',
|
||||
default='',
|
||||
help='path where a mono install contains bin, lib, and include directories')
|
||||
opt.add_option('--self_hosted',
|
||||
action='store',
|
||||
default='no',
|
||||
help='specify this as \"no\" to make a build that can be copied into a legacy build of marsxplr')
|
||||
|
||||
opt.recurse('MarsRuntime')
|
||||
|
||||
@@ -31,18 +35,29 @@ def configure(conf):
|
||||
)[0]
|
||||
)[0]
|
||||
|
||||
conf.env.SELF_HOSTED = conf.options.self_hosted
|
||||
if conf.env.SELF_HOSTED == 'no':
|
||||
print('TAKE NOTE: this build is configured to not be self hosted, meaning it can not run as is and must be copied into a legacy copy of marsxplr')
|
||||
|
||||
conf.recurse('MarsRuntime')
|
||||
|
||||
def build(bld):
|
||||
if bld.cmd == 'distclean':
|
||||
if bld.cmd == 'clean':
|
||||
mbuild = os.path.join(bld.top_dir, 'marsxplr_build')
|
||||
if os.path.exists(mbuild):
|
||||
shutil.rmtree(mbuild)
|
||||
rbuild = os.path.join(bld.top_dir, 'ripper_build')
|
||||
if os.path.exists(rbuild):
|
||||
shutil.rmtree(rbuild)
|
||||
ebuild = os.path.join(bld.top_dir, 'editor_build')
|
||||
if os.path.exists(ebuild):
|
||||
shutil.rmtree(ebuild)
|
||||
return
|
||||
|
||||
bld.env.MONOOPTS = '-sdk:2 -langversion:3'
|
||||
|
||||
bld.recurse('MarsRuntime')
|
||||
if(bld.env.SELF_HOSTED == 'yes'):
|
||||
bld.recurse('MarsRuntime')
|
||||
|
||||
bld.recurse('UnityDomainLoad')
|
||||
bld.recurse('UnityEngine')
|
||||
@@ -51,3 +66,5 @@ def build(bld):
|
||||
bld.add_group()
|
||||
bld.recurse('Assembly_-_CSharp')
|
||||
bld.recurse('Assembly_-_UnityScript')
|
||||
bld.recurse('ripper')
|
||||
bld.recurse('editor')
|
||||
|
||||
Reference in New Issue
Block a user