コード例 #1
0
ファイル: BrickMovement.cs プロジェクト: Wangmmmm/Tetris
 public void OnActivate()
 {
     rotateAnchor = transform.Find("Anchor");
     BricksManager.AddDropEvent(DestroySelf);
     BricksManager.AddDropEvent((Transform) => { Controller = ControlState.player2; });
     DropSpeed    = Manager.Bricks.DropSpeed;
     curGameSpeed = DropSpeed;
 }
コード例 #2
0
ファイル: SpawnManager.cs プロジェクト: Wangmmmm/Tetris
 //生成器一但激活要做的事情
 public void OnActivate()
 {
     //向游戏逻辑管理器添加一个回调函数,当方块不能再下落时就执行该回调函数
     BricksManager.AddDropEvent(SpawnBricks);
     IsSpawn = true;
     Manager.Event.AddListener <GameOverRaws>(StopSpawn);
     SpawnBricks(Manager.Bricks.curBricks);
 }
コード例 #3
0
        /// <summary>
        /// Awake is called when the script instance is being loaded.
        /// </summary>
        void Awake()
        {
            _gameManager     = GetComponent <GameManager>();
            _uiManager       = GetComponent <UIManager>();
            _audioManager    = GetComponent <AudioManager>();
            _scoreManager    = GetComponent <ScoreManager> ();
            _spawnManager    = GetComponent <SpawnManager>();
            _bricksManager   = GetComponent <BricksManager>();
            _eventManager    = GetComponent <EventManager>();
            _dataBaseManager = GetComponent <DataBaseManager>();
            DontDestroyOnLoad(gameObject);

            Manager.Event.OnActivate();

            Manager.Game.OnActivate();
        }