void ServerCountDown(Block block) { if (block == null) { Debug.LogError("block is empty! "); return; } if (!block.isShowModel) { return; } CoroutineUtil.WaitSeconds(() => { // 这里是由于前面被消除了,因此这里是空的 Singleton._sceneService.ShowBlock(block._index, (int index, bool isShow) => { if (index != block._index) { Debug.LogErrorFormat("index与服务器不一致 index={0}, block.index={1}", index, block._index); return; } if (block != null) { // 这里必须是false // block.isShowModel = false; if (isShow) { Debug.LogErrorFormat("服务器给了错误的数据 index={0}, isShow={1}", index, isShow); } block.isShowModel = isShow; } }); }, block._vanishTime); }
public void DestroySelf() { if (_showedBlocks.Contains(this)) { _showedBlocks.Remove(this); } // 销毁的这个协程内不允许输入 Singleton._gameData._permitInput = false; CoroutineUtil.WaitSeconds(() => { Singleton._gameData._permitInput = true; // 增加得分 这个要服务器改 Singleton._blockGenerator.DestroyBlock(this); }, 0.5f); }