protected override void DrawBaseSettings()
        {
            base.DrawBaseSettings();
            TowerConfiguration settings = target as TowerConfiguration;

            UnityObjectField <TowerAnimator>(ref settings.Prefab, ObjectNames.NicifyVariableName(nameof(TowerConfiguration.Prefab)));
            IntField(ref settings.BuildCost, ObjectNames.NicifyVariableName(nameof(TowerConfiguration.BuildCost)));
        }
Пример #2
0
        public void TestDistanceToNextTower()
        {
            TowerConfiguration towerConfig = new TowerConfiguration();

            towerConfig.random = new Random();

            List <int> results = new List <int>();

            for (int i = 0; i < 100; i++)
            {
                results.Add(towerConfig.GetDistanceToNextTower());
            }
            Assert.IsTrue(results.All(a => a > 2 && a < 4));
        }
Пример #3
0
        public void TestMapHeightCalc()
        {
            TowerConfiguration towerConfig = new TowerConfiguration();

            towerConfig.random = new Random();

            List <int> results = new List <int>();

            for (int i = 0; i < 100; i++)
            {
                results.Add(towerConfig.GetNextTowerHeight(16));
            }
            Assert.IsTrue(results.All(a => a > 4 && a < 9));
        }