Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var startManager = new StartManager(new ConsolePlayerCreator());

            startManager.Start();
            WriteInfo();
        }
Exemplo n.º 3
0
 public DeleteStartItemCommand(StartItem startItem, StartManager startMenu)
 {
     this.startItem     = startItem;
     this.startMenu     = startMenu;
     this.startItemName = startItem.Name;
     this.name          = "Delete '" + startItem.Name + "'";
 }
Exemplo n.º 4
0
        private void Init()
        {
            _startManager = new StartManager(new DesktopPlayerCreator());
            _startManager.Init();
            var list = _startManager.Players;

            Players = new ObservableCollection <IPlayer>(list);
        }
Exemplo n.º 5
0
        // 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();
        }
Exemplo n.º 6
0
        public static void Main()
        {
#if NETCOREAPP3_1
            //XamlDisplay.Init();
#endif
            Wpf.AppStart app = new Wpf.AppStart();
            StartManager.Start();
            app.Run();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            CMDOutput.OnStartUp();

            StartManager.Initialize(Assembly.GetExecutingAssembly());

            HandleCommand();

            Console.Read();
        }
Exemplo n.º 8
0
 public void Reset()
 {
     gameMaster   = GameMaster.instance;
     startManager = StartManager.instance;
     itemDamage   = 0;
     itemDefense  = 0;
     itemHealth   = 0;
     itemMana     = 0;
     SetLevel(1);
 }
Exemplo n.º 9
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Exemplo n.º 10
0
 private void Start()
 {
     gameMaster   = GameMaster.instance;
     startManager = StartManager.instance;
     startManager.OnSaveSystemCallBack += SaveInventory;
     startManager.OnLoadSystemCallBack += LoadInventory;
     foreach (Item item in starterItems)
     {
         AddItem(item, 1);
     }
 }
Exemplo n.º 11
0
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("More than one StartManager Instance found");
         Destroy(this);
         return;
     }
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 12
0
    // 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();
    }
Exemplo n.º 13
0
 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;
 }
Exemplo n.º 14
0
	   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);
	   }
Exemplo n.º 15
0
    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);
    }
Exemplo n.º 16
0
 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;
     }
 }
Exemplo n.º 17
0
        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);
        }
Exemplo n.º 18
0
    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();
        }
    }
Exemplo n.º 19
0
 void Awake()
 {
     Instance = this;
 }
Exemplo n.º 20
0
	   public DeleteStartItemCommand(StartItem startItem, StartManager startMenu) {
		  this.startItem = startItem;
		  this.startMenu = startMenu;
		  this.startItemName = startItem.Name;
		  this.name = "Delete '" + startItem.Name + "'";
	   }
Exemplo n.º 21
0
    public Text messageText;                                        //消息文本

    private void Awake()
    {
        _instance = this;
    }
Exemplo n.º 22
0
 void Start()
 {
     startManager = GameObject.Find("StartManager").GetComponent <StartManager>();
 }
Exemplo n.º 23
0
	   public static MoveStartItemCommand[] Categorize(ICategoryProvider template, StartManager start) {
		  return Categorize(template, start, "", true, false);
	   }
Exemplo n.º 24
0
	   public static MoveStartItemCommand[] Categorize(ICategoryProvider template, StartManager start, string directory, bool forceAllFilters) {
		  return Categorize(template, start, directory, false, forceAllFilters);
	   }
Exemplo n.º 25
0
	   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();
	   }
Exemplo n.º 26
0
 private void Awake()
 {
     _canvas = GetComponentInChildren <Canvas>();
     _img    = GetComponentInChildren <Image>();
     _sm     = FindObjectOfType <StartManager>();
 }