yyl
2025-06-17 007fbd542c30f5fa8308128aac26ce6584b3067a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Collections.Generic;
using UnityEngine;
 
 
 
public class TeamManager : GameSystemManager<TeamManager>
{
    protected Dictionary<TeamType, TeamBase> teamDict = new Dictionary<TeamType, TeamBase>();
 
    public override void Init()
    {
        base.Init();
    }
 
    public override void Release()
    {
        base.Release();
    }
 
    public TeamBase GetTeam(TeamType teamType)
    {
        TeamBase team = null;
 
        if (!teamDict.TryGetValue(teamType, out team))
        {
            team = GetStoryTeam();
            teamDict.Add(teamType, team);
        }
 
        return team;
    }    
 
    public TeamBase GetStoryTeam()
    {
        TeamBase team = null;
 
        if (!teamDict.TryGetValue(TeamType.Story, out team))
        {
            team = new TeamBase();
            team.AddTeamHeros(HeroManager.Instance.GetPowerfulHeroList());
            teamDict.Add(TeamType.Story, team);
        }
 
        return team;
    }
}