Exemplo n.º 1
0
        private WarriorController CreateNewWarrior(Vector2 pos, StructureOfWarrior str, int team, NeuralAI ai, BattlePlayer pla)
        {
            var newObj = Instantiate(warrPref, warriorsParent.transform);

            var scrpt = newObj.GetComponent <WarriorController>();

            scrpt.Initialize(pos, str, team, ai, pla);

            return(scrpt);
        }
        public WarriorController CreateNewWarrior(Vector2 pos, StructureOfWarrior str, int team, NeuralAI ai, PlayerController pla)
        {
            var newObj = Instantiate(warrPref, warriorsParent.transform);

            var scrpt = newObj.GetComponent <WarriorController>();

            scrpt.Initialize(pos, str, team, ai, pla);

            scrpt.rigidbody2d.rotation = UnityEngine.Random.Range(-180, 180);//TODO: fix this; implement random angle

            return(scrpt);
        }