Пример #1
0
 public static FootballerAnimResource get_footballer_anim_resource(FootballerResourceKey key)
 {
     if (_footballer_key_to_anim_resc == null)
     {
         SpriteResourceDB.Initialize();
     }
     return(_footballer_key_to_anim_resc[key]);
 }
Пример #2
0
 public void sim_initialize(Vector2 position, Vector2 vel)
 {
     this.transform.position = position;
     _vel = vel;
     _z   = 0;
     _vz  = Mathf.Min(vel.magnitude * 0.25f, 15);
     _initial_uncatchable_ct = 20;
     _animator = this.gameObject.AddComponent <SpriteAnimator>();
     _animator.add_anim(
         "ball", SpriteResourceDB.get_ball_anim(), 5
         );
     _animator._tar = _renderer;
     _animator.play_anim("ball");
 }
Пример #3
0
    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>();
        }
    }
Пример #4
0
    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);
    }