Exemplo n.º 1
0
    public override void Init()
    {
        AppContext.managerList = new List <IModule>();
        AppContext.ToBeAdd     = new List <IModule>();
        base.Init();

        SceneRoot = new GameObject("SceneRoot");
        SceneRoot.ResetTransform(transform);

        mono = gameobject.AddComponent <GameMono>();
        UnityEngine.Object.DontDestroyOnLoad(gameobject);
    }
Exemplo n.º 2
0
 public void Subscribe(GameMono obj)
 {
     GameMono[] temp = Monos;
     Monos = new GameMono[temp.Length + 1];
     for (int i = 0; i < temp.Length; i++)
     {
         Monos[i] = temp[i];
     }
     obj.gameId         = currId;
     Monos[temp.Length] = obj;
     currId++;
 }
Exemplo n.º 3
0
    public void Unsubscribe(GameMono obj)
    {
        int tempId = 0;

        GameMono[] temp = Monos;
        Monos = new GameMono[temp.Length - 1];
        for (int i = 0; i < temp.Length; i++)
        {
            if (temp[i].gameId != obj.gameId)
            {
                Monos[tempId] = temp[i];
                tempId++;
            }
        }
    }