Example #1
0
    private void Start()
    {
        GlobalEvent.Init();

        GlobalEvent.AddEvent(GameEnums.Hello, Say_Hello_A);

        GlobalEvent.DispatchEvent(GameEnums.Hello, "1", "2", "3", "4");

        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);
        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);
        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);
    }
Example #2
0
    public static void Init()
    {
        _serializer     = new _Serializer();
        _serverCallback = new ServerCallback();
        _serverManager  = ServerManager.Instance;
        _messageManager = new MessageManager();
        _globalEvent    = new GlobalEvent();
        _globalEvent.Init();
        _viewLib      = _serverManager._viewLib;
        _uiManager    = _serverManager._uiManager;
        _loginService = new LoginService();
        _sceneManager = new SceneManager();
        _sceneService = new SceneService();
        _loginManager = new LoginManager();

        _gameManager    = GameManager._instance;
        _gameReference  = _gameManager._gameReference;
        _blockGenerator = new BlockGenerator();
        _gameData       = new GameData();
        _randomUtil     = new RandomUtil();
        _excelUtil      = new ExcelUtil();
    }
Example #3
0
    private void Start()
    {
        //init
        GlobalEvent.Init();

        //dispatch string
        GlobalEvent.AddEvent(GameEnums.Hello, Say_Hello_A);
        GlobalEvent.DispatchEvent(GameEnums.Hello, "Hello!");
        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);

        //dispathc class
        GlobalEvent.AddEvent(GameEnums.Hello, Say_Hello_B);
        GlobalEvent.DispatchEvent(GameEnums.Hello, EventData.New(new Dictionary <string, object>
        {
            { "pos", Vector2.zero },
            { "id", 120 }
        }));

        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_B);

        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);
        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);
        GlobalEvent.RemoveEvent(GameEnums.Hello, Say_Hello_A);
    }