private TankManager m_GameWinner; // Reference to the winner of the game. Used to make an announcement of who won private void Start() { // Create the delays so they only have to be made once m_StartWait = new WaitForSeconds(m_StartDelay); m_EndWait = new WaitForSeconds(m_EndDelay); gameEnd_wait = new WaitForSeconds(gameEnd_delay); starting_players = startManager.GetComponent <StartManager>(); players_on_start = starting_players.GetStartPlayers(); UI_2players.SetActive(false); UI_MultPlayers.SetActive(false); for (int i = 0; i < deathCameras.Length; i++) { deathCameras[i].gameObject.SetActive(false); } mapView.SetActive(false); mapCam = mapView.gameObject.GetComponent <Camera>(); mapCam.rect = new Rect(0.5f, 0.0f, 0.5f, 0.5f); SpawnAllTanks(); SetCameraTargets(); // Once the tanks have been created and the camera is using them as targets, start the game StartCoroutine(GameLoop()); }
static void Main(string[] args) { var startManager = new StartManager(new ConsolePlayerCreator()); startManager.Start(); WriteInfo(); }
public DeleteStartItemCommand(StartItem startItem, StartManager startMenu) { this.startItem = startItem; this.startMenu = startMenu; this.startItemName = startItem.Name; this.name = "Delete '" + startItem.Name + "'"; }
private void Init() { _startManager = new StartManager(new DesktopPlayerCreator()); _startManager.Init(); var list = _startManager.Players; Players = new ObservableCollection <IPlayer>(list); }
// public static void Main(string[] args) public static void Main() { // Opstarten Dependency Injection en processen // is verplaatst naar een non-static method: StartBackGround(). var backgroundManager = new StartManager(); // hierbinnen: DI backgroundManager.StartBackGround(); }
public static void Main() { #if NETCOREAPP3_1 //XamlDisplay.Init(); #endif Wpf.AppStart app = new Wpf.AppStart(); StartManager.Start(); app.Run(); }
static void Main(string[] args) { CMDOutput.OnStartUp(); StartManager.Initialize(Assembly.GetExecutingAssembly()); HandleCommand(); Console.Read(); }
public void Reset() { gameMaster = GameMaster.instance; startManager = StartManager.instance; itemDamage = 0; itemDefense = 0; itemHealth = 0; itemMana = 0; SetLevel(1); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
private void Start() { gameMaster = GameMaster.instance; startManager = StartManager.instance; startManager.OnSaveSystemCallBack += SaveInventory; startManager.OnLoadSystemCallBack += LoadInventory; foreach (Item item in starterItems) { AddItem(item, 1); } }
void Awake() { if (instance != null) { Debug.LogError("More than one StartManager Instance found"); Destroy(this); return; } instance = this; DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { xmlPath = Resources.Load("ShopData").ToString(); if (!File.Exists(SavePath)) { File.WriteAllText(SavePath, content); } shopData = new ShopData(); shopData.ReadXmlByPath(xmlPath); shopData.ReadScoreAndGold(SavePath); Debug.Log(shopData.goldCount); Debug.Log(shopData.heightScore); ui_ShopItem = Resources.Load <GameObject>("UI/ShopItem"); LeftButtpn = GameObject.Find("LeftButton"); RightButtpn = GameObject.Find("RightButton"); StarNum = GameObject.Find("Star/StarNum").GetComponent <UILabel>(); ScoreNum = GameObject.Find("Score/ScoreNum").GetComponent <UILabel>(); m_StartManager = GameObject.Find("UI Root").GetComponent <StartManager>(); int tempHeightScore = PlayerPrefs.GetInt("HeightScore", 0); if (tempHeightScore > shopData.heightScore) { UpdateUIHeightScore(tempHeightScore); shopData.UpdateXMLData(SavePath, "HeightScore", tempHeightScore.ToString()); PlayerPrefs.SetInt("HeightScore", 0); } else { UpdateUIHeightScore(shopData.heightScore); } int tempGold = PlayerPrefs.GetInt("GoldNum", 0); if (tempGold > 0) { int gold = shopData.goldCount + tempGold; UpdateUIGold(gold); shopData.UpdateXMLData(SavePath, "GoldCount", gold.ToString()); PlayerPrefs.SetInt("GoldNum", 0); } else { UpdateUIGold(shopData.goldCount); } UIEventListener.Get(LeftButtpn).onClick = leftButtpnClick; UIEventListener.Get(RightButtpn).onClick = rightButtpnClick; SetPlayerInfo(shopData.ShopList[0]); CreateAllShopUI(); }
public override void Start() { gameMaster = GameMaster.instance; startManager = StartManager.instance; audioSource = GetComponent <AudioSource>(); base.Start(); questHolder = GameObject.FindGameObjectWithTag("QuestHolder"); playerStats = gameMaster.playerStats; questPanel = gameMaster.questPanel; Quest = (Quest)questHolder.AddComponent(System.Type.GetType(questType)); startManager.OnSaveSystemCallBack += SaveQuest; startManager.OnLoadSystemCallBack += LoadQuest; }
public TemplateEditor(StartManager manager, TemplateProvider template) { InitializeComponent(); this.Icon = SMOz.Properties.Resources.Application; this.template = template; this.manager = manager; var uncategorized = from t in manager.GetByCategory("") select t.Name; InitializeTable(uncategorized.ToArray(), KnownCategories.Instance.ToArray()); AddToTable(string.Empty); }
void RespawnPlayer() { //Move player back to respawn point Player.transform.position = Respawn.transform.position; //Re-enable and reset all enemies for (int i = 0; i < enemies.Length; i++) { enemies[i].Health = 100f; enemies[i].gameObject.SetActive(true); } Cursor.lockState = CursorLockMode.None; StartManager.InitGame(); canvas.SetActive(true); }
private void Awake() { Instance = this; SoundManager.Initialize(); nodeDiameter = nodeRadius * 2; RenderSettings.skybox.SetColor("_TintColor", new Color32(255, 250, 30, 255)); if ((Screen.height / Screen.width) >= 2) { Camera.main.orthographicSize = 8; } else { Camera.main.orthographicSize = 7; } }
public void StartListener() { if (startManager == null) { startManager = FindObjectOfType <StartManager>(); } if (!_started) { startManager.DeployClient(); listener = new UdpClient(Port); groupEp = new IPEndPoint(IPAddress.Any, Port); _started = true; Listen(); } }
void Awake() { Instance = this; }
public Text messageText; //消息文本 private void Awake() { _instance = this; }
void Start() { startManager = GameObject.Find("StartManager").GetComponent <StartManager>(); }
public static MoveStartItemCommand[] Categorize(ICategoryProvider template, StartManager start) { return Categorize(template, start, "", true, false); }
public static MoveStartItemCommand[] Categorize(ICategoryProvider template, StartManager start, string directory, bool forceAllFilters) { return Categorize(template, start, directory, false, forceAllFilters); }
private static MoveStartItemCommand[] Categorize(ICategoryProvider template, StartManager start, string category, bool rootAndRestricted, bool forceAllFilters) { List<MoveStartItemCommand> result = new List<MoveStartItemCommand>(); IEnumerable<StartItem> items; if (rootAndRestricted) { items = start.StartItems; } else { items = start.GetByCategory(category); } foreach (StartItem currentItem in items) { Category predicted = template.FindCategory(currentItem.Name); bool proceed = false; if (predicted != null) { if (string.IsNullOrEmpty(currentItem.Category)) { // Item is located in the root folder // Proceed unless the filter is restricted proceed = !predicted.IsRestricted; // Proceed anyways if forced if (!proceed && forceAllFilters) { proceed = true; Debug.WriteLine("[Restricted: FORCED]" + currentItem.Name); } else { Debug.WriteLine("[Empty: " + (proceed ? "OK]" : "SKIP]") + currentItem.Name); } } else { // Item is not in the root folder bool restricted = !string.IsNullOrEmpty(predicted.RestrictedPath); if (restricted && (string.Compare(currentItem.Category, predicted.RestrictedPath, true) == 0)) { // Item is located in a restricted folder; which is handled by the predicted filter Debug.WriteLine("[Restricted: OK] " + currentItem.Name); proceed = true; } else { // Item is NOT in a restricted folder or the root if (!rootAndRestricted) { // Items are from a subset; if(forceAllFilters){ Debug.WriteLine("[Not In Root: FORCED]" + currentItem.Name); proceed = true; }else if(!restricted){ Debug.WriteLine("[Not In Root: NOT RESTRICTED; OK]" + currentItem.Name); proceed = true; }else{ Debug.WriteLine("[Not In Root: RESTRICTED; SKIP]" + currentItem.Name); proceed = false; } } else { // never applied Debug.WriteLine("[Not In Root: SKIP]" + currentItem.Name); proceed = false; } } } } if (proceed) { result.Add(new MoveStartItemCommand(currentItem, predicted.Name)); } } return result.ToArray(); }
private void Awake() { _canvas = GetComponentInChildren <Canvas>(); _img = GetComponentInChildren <Image>(); _sm = FindObjectOfType <StartManager>(); }