void Start() { startUp = GameObject.Find("Main Camera").GetComponent("OnStartUp") as OnStartUp; inputPath = startUp.inputPath; ReadFile rf = new ReadFile(); rf.read(inputPath); maxAgents = rf.maxAgents; agentFrames = rf.agentFrames; agentCoords = rf.agentCoords; deltas = rf.deltas; distances = rf.distances; agentNum = 0; /* Create all of the agents from the specified file. */ for (int count = 0; count < agentFrames.Count; count += 2) { a = ScriptableObject.CreateInstance <agent>(); a.setStart(agentFrames[count]); a.setDur(agentFrames[count + 1]); a.setCoords(agentCoords); a.setDeltas(deltas); a.setDistance(distances); a.id = agentNum; agentList.Add(a); int range = agentFrames[count + 1] + 1; if (range < agentCoords.Count) { agentCoords.RemoveRange(0, range); deltas.RemoveRange(0, range); distances.RemoveRange(0, range); } agentNum++; } //agentNum = 0; //while (agentNum < maxAgents) //{ // if (0 == agentList[agentNum].getStart()) // { // agentList[agentNum].create(); // } // agentNum++; //} }
public static void Main(string[] args) { OnStartUp.Init(); var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup <Startup>() .Build(); host.Run(); }
public MainWindowViewModel() { OnStartUp onStartUp = new OnStartUp(); onStartUp.RunOnStartUp(); GetAssemblyVersion(); ShowBoxCommand = new RelayCommand(ShowBox); ShowSettingsCommand = new RelayCommand(ShowSettings); ShowBigBoxCommand = new RelayCommand(ShowBigBox); ShowCustomCommand = new RelayCommand(ShowCustom); ShowCertificationNominateCommand = new RelayCommand(ShowCertificationNominate); ShowCertificationLvlCommand = new RelayCommand(ShowCertificationLvl); }
public static void Main(string[] args) { if (args.Length > 0) { ConsoleWrapper.WriteLine(args[0]); } string appGuid = System.Runtime.InteropServices.Marshal .GetTypeLibGuidForAssembly(System.Reflection.Assembly.GetExecutingAssembly()).ToString(); var nonExisted = false; var mtx = new System.Threading.Mutex(true, appGuid, out nonExisted); if (!nonExisted) { ConsoleWrapper.ShowError("Application already runs!"); System.Threading.Thread.Sleep(3000); return; } OnStartUp.Load(); UserInterface.Run(args); }
private void MainLoop() { try { Interlocked.CompareExchange(ref state, RUNNING, STARTUP_PENDING); OnStartUp?.Invoke(); while (true) { if (Queue.TryDequeue(out var text)) { Console.WriteLine("{0}", text); OnPutLine?.Invoke(text); } else if (state == RUNNING) { Enqueued.WaitOne(); } else { break; } } Interlocked.Exchange(ref state, SHUTDOWN); OnShutDown?.Invoke(); } catch (Exception e) { Interlocked.Exchange(ref state, ERROR); Console.Error.WriteLine("ERROR: {0}", e.Message); while ((e = e.InnerException) != null) { Console.Error.WriteLine(" {0}", e.Message); } OnError?.Invoke(e); } }
public void CQStartup(object obj, CQStartupEventArgs e) { //Main.Initialize(); OnStartUp?.Invoke(obj, e); }
void start() { startUp = GameObject.Find("Main Camera").GetComponent("OnStartUp") as OnStartUp; Time.captureFramerate = startUp.frameRate; }