/// <summary> /// /// </summary> /// <param name="nick"></param> /// <param name="server"></param> /// <param name="chan"></param> /// <param name="game"></param> /// <param name="mainWin"></param> /// <param name="identify"></param> /// <param name="pass">used to indetify with NickServ</param> /// <param name="bot">Name of NickServ bot</param> public DChatClient(String nick, String server, String chan, int game, MainWindow mainWin, bool identify, string pass, string bot) { mw = mainWin; this.nick = nick; this.server = server; this.chan = chan; clientId = game; identifyToNickServ = identify; userpass = pass; nickservbot = bot; ini = new IniFile(System.IO.Path.Combine(Environment.CurrentDirectory, @"config.ini")); rnd = new Random(); users = new List <User>(); try { firstRun = (Boolean.Parse(ini.IniReadValue("Settings", "firstrun"))); } catch (FormatException e) { firstRun = false; } try { secondRun = (Boolean.Parse(ini.IniReadValue("Settings", "2ndrun"))); } catch (FormatException e) { secondRun = false; } try { elnotif = (Boolean.Parse(ini.IniReadValue("Settings", "enterleave"))); } catch (FormatException e) { elnotif = false; } cw = new DChatWindow(nick, chan, mw, this); sm = new SpawnMaster(nick, server, chan, cw.getBanner()); sm.ads.Add("warchest"); sw = new DSettingsWindow(cw, this); DoConnect(); if (firstRun) { cw.AddToChatWindow(8, null, sm.clientMsg[0]); ini.IniWriteValue("Settings", "2ndrun", true.ToString()); ini.IniWriteValue("Settings", "firstrun", false.ToString()); } if (secondRun) { cw.AddToChatWindow(8, null, sm.clientMsg[1]); ini.IniWriteValue("Settings", "2ndrun", false.ToString()); } }
// Start is called before the first frame update void Awake() { // get AI enemyAI = GetComponent <EnemyAI>(); // Why does this NULL out one me? // set time left timeLeft = 60f; // get conductor spawnMaster = GameObject.FindObjectOfType <SpawnMaster>(); // self rigidBody = GetComponent <Rigidbody2D>(); // get borders spawnPoint = spawnMaster.spawnPoints[spawnPointIndex].GetComponent <SpawnPointController>(); // Init AI }
bool showDifficultyStats = false; // Show the wave's difficulty settings? public override void OnInspectorGUI() { // Get the current script and its values SpawnMaster myTarget = (SpawnMaster)target; // Signal to use GUI.changed, for setting this dirty and saving it GUI.changed = false; // The necessary Pools myTarget.activePool = EditorGUILayout.ObjectField("Active Pool (GO)", myTarget.activePool, typeof(GameObject), true) as GameObject; myTarget.spawnPool0 = EditorGUILayout.ObjectField("Spawn Pool0 (Transform)", myTarget.spawnPool0, typeof(SpawnPool), true) as SpawnPool; EditorGUILayout.LabelField(""); // Just an empty line as a smaller separater // Displays SpawnCore statistics showStatistics = EditorGUILayout.Foldout(showStatistics, "Show Spawn Statistics"); if (showStatistics) { EditorGUILayout.HelpBox("Spawn Statistics of the entire game" , MessageType.Info); GUILayout.Box("Total Spawned: " + SpawnCore.totalSpawned); GUILayout.Box("Current Wave: " + SpawnCore.currentWave); GUILayout.Box("This Wave's Goal: " + SpawnCore.thisWave_goal); GUILayout.Box("This Wave's Spawned: " + SpawnCore.thisWave_spawned); GUILayout.Box("This Wave's Destroyed: " + SpawnCore.thisWave_defeated); EditorGUILayout.LabelField("<----->"); // Spacer/Separator } // Displays SpawnCore statistics showDifficultyStats = EditorGUILayout.Foldout(showDifficultyStats, "Show Spawn Statistics"); if (showDifficultyStats) { EditorGUILayout.HelpBox("Difficulty stats for the current wave (" + SpawnCore.currentWave + ")" , MessageType.Info); GUILayout.Box("Spawn Delay: " + SpawnCore.spawnDelay); GUILayout.Box("Max Attack Delay: " + SpawnCore.attackDelay_Max); GUILayout.Box("Min Attack Delay: " + SpawnCore.attackDelay_Min); GUILayout.Box("Max Size Multiplier: " + SpawnCore.sizeMultiplier_Max); GUILayout.Box("Min Size Multiplier: " + SpawnCore.sizeMultiplier_Min); EditorGUILayout.LabelField("<----->"); // Spacer/Separator } EditorGUILayout.LabelField("-----------"); // Spacer/Separator // Code for showing the default Inspector showDefault = EditorGUILayout.Foldout(showDefault, "Show Default Inspector"); if (showDefault) { DrawDefaultInspector(); } // If anything was changed, then tell Unity that this prefab was changed so it saves if (GUI.changed) { EditorUtility.SetDirty(myTarget); } } // End OnInspectorGUI
void Start() { rnd = new System.Random(); player = GameObject.FindWithTag("Player"); spawnMaster = gameObject.GetComponent <EnemyController>().spawnMaster; }
void Awake() { // Make sure Instance is set to this Instance = this; }
// se uporabljajo za random spawnanje private void freePozition() { SpawnMaster.freePozition(pozitionNumber); }
private void OnDestroy() { Instance = null; }
private void Start() { Debug.Assert(Instance == null, "There are multiple SpawnMasters running at the same time."); Instance = this; }