private void Start() { inventory = GetComponent <ShellInventory>(); firepoint = transform.Find("GunRotationParent").Find("Gun").Find("FirePoint").gameObject; inventory.AddShell(0, 5); currentShell = Shells.singleton.FindShellByID(0); }
public ShellBase CreateShell(ShellBase parent) { var mainCreated = _mainCreated; _mainCreated = true; return(CreateCustomShell(() => CreateShell(!mainCreated), parent)); }
public CompilerResult(Kind kind, string sourceFile, string outFile, ShellBase shell) { Kind = kind; OutputFile = outFile; SourceFile = sourceFile; Succeeded = (shell.ExitCode == 0); ErrorList = shell.StandardError.GetErrors(); ExecutionTime = (shell.ExitTime.Ticks - shell.StartTime.Ticks); }
public ShellBase CreateShell(ShellBase parent) { var rv = CreateShell(!_shells.Any()); if (parent != null) { rv.Owner = parent; } return(rv); }
public void ChangeShell(int shellID) { ShellBase shell = Shells.singleton.FindShellByID(shellID); if (shell == null) { return; } currentShell = shell; }
public void ReleaseShell(ShellBase shell) { ShellConfig cfg = Config.ShellCfg[shell.ID - 1]; if (shell.Hole != null) { ReleasePrefab(cfg.hole, shell.Hole); } shell.OnDetach(); shell.OnUninit(); ReleasePrefab(cfg.prefab, shell.gameObject); }
public ShellBase CreateShell(int weaponid, Transform parent) { WeaponConfig weapon = Config.WeaponCfg[weaponid - 1]; ShellConfig cfg = Config.ShellCfg[weapon.shell - 1]; GameObject obj = CreatePrefab(cfg.prefab); ShellBase shell = obj.GetComponent <ShellBase>(); shell.gameObject.SetActive(true); shell.transform.parent = parent; shell.transform.localPosition = Vector3.zero; shell.transform.localRotation = Quaternion.identity; shell.ID = cfg.id; shell.WeaponID = weaponid; shell.name = "shell_" + cfg.id; shell.OnInit(); return(shell); }
public ShellBase CreateCustomShell(Func <ShellBase> creationAction, ShellBase parent) { var t = this; ShellBase shell = null; if (parent != null) { parent.Dispatcher.Invoke(() => { shell = creationAction(); shell.Owner = parent; // Register newly created shell base for existing thread. _dictionary[shell.Dispatcher.Thread].Add(shell); }); } else { var mre = new ManualResetEventSlim(); var thread = new Thread(() => { shell = creationAction(); mre.Set(); Dispatcher.CurrentDispatcher.UnhandledException += DomainExceptionHandler.OnUnhandledDispatcherException; Dispatcher.Run(); }); thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = true; thread.Start(); thread.Name = "Window thread"; mre.Wait(); // Register new thread with newly created shell base. _dictionary[thread] = new List <ShellBase>() { shell }; } shell.Closed += ShellOnClosed; return(shell); }
/// <inheritdoc /> public void Unloading(ShellBase owner) { Debugger.Break(); }
/// <inheritdoc /> public void Navigated(ShellBase owner, ShellBase parent) { Debugger.Break(); }
public ShellBase CreateCustomShell(Func <ShellBase> creationAction, ShellBase parent) { return(creationAction()); }
private void Start() { shell = Shells.singleton.FindShellByID(0); }
public void SetShell(ShellBase shell) { this.shell = shell; }