private void OnEnable()
 {
     photonTeams      = target as PhotonTeamsManager;
     teamsListSp      = serializedObject.FindProperty("teamsList");
     listFoldIsOpenSp = serializedObject.FindProperty("listFoldIsOpen");
     isOpen           = listFoldIsOpenSp.boolValue;
     removeTexture    = LoadTexture(removeTextureName, proSkinString, lightSkinString);
 }
Esempio n. 2
0
 private void Awake()
 {
     if (instance == null || ReferenceEquals(this, instance))
     {
         this.Init();
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
 private void Awake()
 {
     if (instance == null || ReferenceEquals(this, instance))
     {
         instance = this;
     }
     else
     {
         Destroy(this);
         return;
     }
     teamsByCode    = new Dictionary <byte, PhotonTeam>(teamsList.Count);
     teamsByName    = new Dictionary <string, PhotonTeam>(teamsList.Count);
     playersPerTeam = new Dictionary <byte, HashSet <Player> >(teamsList.Count);
     for (int i = 0; i < teamsList.Count; i++)
     {
         teamsByCode[teamsList[i].Code]    = teamsList[i];
         teamsByName[teamsList[i].Name]    = teamsList[i];
         playersPerTeam[teamsList[i].Code] = new HashSet <Player>();
     }
 }