Exemplo n.º 1
0
        private void ChangePlayerCustomisationContext(int playerID)
        {
            this.playerID = playerID;

            customisationData = CManager.GetPlayerCustomisation(playerID);
            OnPlayerChange.Invoke(customisationData);
            DragonHelper.SetDragonAsPlayer(customisationData, DemoDragon);

            UpdateUI(playerID);
        }
Exemplo n.º 2
0
        private void Start()
        {
            gManager = SingletonHelper.Find(SingletonEnums.GameManager).GetComponent <GameManager>();
            cManager = SingletonHelper.Find(SingletonEnums.CustomisationManager).GetComponent <CustomisationManager>();

            if (gManager)
            {
                var humanCount = gManager.GameData.HumanCount;
                var aiCount    = gManager.GameData.AICount;

                var playersDragons = Enumerable
                                     .Range(0, humanCount)
                                     .Select(i => {
                    var dragon = CreateDragon(i);
                    DragonHelper.SetDragonAsPlayer(
                        cManager.GetPlayerCustomisation(i),
                        dragon);
                    return(dragon);
                });

                var aiDragons = Enumerable
                                .Range(humanCount, aiCount)
                                .Select(i => CreateDragon(i));

                dragons = playersDragons.Concat(aiDragons).ToArray();
            }
            else   /* Standalone Scene Mode */
            {
                dragons = FindObjectsOfType <DragonController>()
                          .Select(drc => drc.gameObject)
                          .ToArray();

                foreach (var dragon in dragons)
                {
                    alivePlayers.Add(dragon);
                    dragon.GetComponent <DamageController>().onDeath += OnDragonDeath;
                }
            }

            PositionPlayers();
        }
Exemplo n.º 3
0
 public void UpdateDragon()
 {
     DragonHelper.SetDragonAsPlayer(customisationData, DemoDragon);
 }