protected override void OnMainBegin() { Application.targetFrameRate = 60; Cursor.visible = false; Main._current_level = GameLevel.Level1; Main._current_repeat_reason = RepeatReason.None; SpriteResourceDB.get_footballer_anim_resource(FootballerResourceKey.Player1); _instance = (Main)Uzu.Main.Instance; // InitGraphicsSettings (); // InitInputSettings (); // Singleton creation. { //_gameCamera = GameObject.Find("GameCamera").GetComponent<FollowCamera>(); //_fanController = GetComponent<FanController>(); //_fieldController = GameObject.Find("FieldController").GetComponent<FieldController>(); } }
private void SpawnTeam(int centerRegion, TeamBase team, int[] regions, FootballerResourceKey[] resources, FieldPosition[] fieldPositions) { const float startOffset = 100.0f; Vector3 centerPos = Main.FieldController.GetRegionPosition(centerRegion); float deltaAngle = Mathf.Deg2Rad * (360.0f / regions.Length); List <BotBase> bots = new List <BotBase>(regions.Length); for (int i = 0; i < regions.Length; i++) { BotBase bot = this.CreateFootballer(team, centerPos + Uzu.Math.RadiansToDirectionVector(deltaAngle * i) * startOffset, SpriteResourceDB.get_footballer_anim_resource(resources[i])); bot.HomePosition = Main.FieldController.GetRegionPosition(regions[i]); bot.FieldPosition = fieldPositions[i]; bots.Add(bot); } team.SetPlayers(bots); }