private static void MakeBuild(Settings settings) { if (settings.Scenes == null || settings.Scenes.Length == 0) { settings.Reset(); throw new UnityException("No scenes to build."); } Directory.CreateDirectory(BuildFolder); UnityException exc = null; try { BuildPipeline.BuildPlayer( settings.Scenes, BuildFolder + "/" + settings.ApkName + ".apk", BuildTarget.Android, BuildOptions.None); } catch (UnityException e) { exc = e; } settings.Reset(); if (exc != null) { throw exc; } }
static int _CreateUnityException(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { UnityException obj = new UnityException(); LuaScriptMgr.PushObject(L, obj); return(1); } else if (count == 1) { string arg0 = LuaScriptMgr.GetString(L, 1); UnityException obj = new UnityException(arg0); LuaScriptMgr.PushObject(L, obj); return(1); } else if (count == 2) { string arg0 = LuaScriptMgr.GetString(L, 1); Exception arg1 = LuaScriptMgr.GetNetObject <Exception>(L, 2); UnityException obj = new UnityException(arg0, arg1); LuaScriptMgr.PushObject(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: UnityException.New"); } return(0); }
public void InvalidSpawnable() { string invalidSpawnable = "Boogeroo"; string[] data = new string[] { "<spawnerconfiguration>", "\t<level>", $"\t\t<spawnable type=\"{invalidSpawnable}\">", "\t\t\t<pattern>", "\t\t\t\t<limit>1</limit>", "\t\t\t\t<rate>0</rate>", "\t\t\t\t<delay>0</delay>", "\t\t\t\t<maxDistance>0</maxDistance>", "\t\t\t\t<minDistance>0</minDistance>", "\t\t\t</pattern>", "\t\t</spawnable>", "\t</level>", "</spawnerconfiguration>" }; File.WriteAllLines(file, data); var error = $"Error in {file}:\n" + $"{invalidSpawnable} is not a valid type of spawnable."; UnityException ex = Assert.Throws <UnityException>(() => ParseSpawnPattern(file) ); Assert.That(ex.Message, Is.EqualTo(error)); }
public static void exception(Module module, object message) { if (isEnable(module, Level.Exception)) { UnityException uex = new UnityException("[EXCEPTION] [" + module + "]" + message + "[" + Timer.getInstance().getTimeStr() + "]"); Debug.LogException(uex); } }
void OnValidate() { if (Parent != this) { RecalculateLevel(); Debug.Log("updated"); } else { Parent = null; UnityException E = new UnityException("WARN: Ошибка присваивания родительского узла элементу: " + this.ToString()); Debug.LogException(E); } }
public static int constructor(IntPtr l) { int result; try { int num = LuaDLL.lua_gettop(l); if (num == 1) { UnityException o = new UnityException(); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } else if (num == 2) { string message; LuaObject.checkType(l, 2, out message); UnityException o = new UnityException(message); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } else if (num == 3) { string message2; LuaObject.checkType(l, 2, out message2); Exception innerException; LuaObject.checkType <Exception>(l, 3, out innerException); UnityException o = new UnityException(message2, innerException); LuaObject.pushValue(l, true); LuaObject.pushValue(l, o); result = 2; } else { result = LuaObject.error(l, "New object failed."); } } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
public IEnumerator SpawnerShouldNotBeRestartedWhileRunning() { Spawner spawner = Spawner.Create( TestEnemy.Create(), 100, 100f, 100f, 100f, 1f); UnityException error = null; yield return(null); try { spawner.StartSpawning(); spawner.StartSpawning(); } catch (UnityException e) { error = e; } Assert.IsNotNull(error, "Should not be able to restart a spawner while it is" + " currently spawning" ); }