private void PrepareNewPiece() { _pieceController = null; _pieceController = GetPiece(); _pieceController.SetValue(Random.Range(1, _currentLevel + 1)); _pieceController.Init(transform, pieceBulletPosition); }
public void TestPiece() { PieceController t = new PieceController(); t.Init(1, 1, new Match3Core.Grid(), Match3Core.PieceType.NORMAL); Assert.That(t.X == 1); }
IEnumerator GameLoopCoroutine() { while (first == null || last == null) { yield return(null); } isGameFinish = false; isTurnChanged = true; ShogiNetwork network = ShogiNetwork.Instance; PieceController controller = PieceController.Instance; controller.Init(); History history = History.Instance; history.Init(); bool isPlayer = me.GetRole() == UserInfo.Role.Player; while (!IsGameFinish) { if (isPlayer) { if ((!PromotionWindow.IsShowing) && isTurnChanged) { network.GetPiecesInfo(me.PlayId, ParsePieces); isTurnChanged = false; } network.GetBattleInfo(me.PlayId, ParseBattleInfo); yield return(new WaitForSeconds(1f)); } else { network.GetPiecesInfo(me.PlayId, ParsePieces); network.GetBattleInfo(me.PlayId, ParseBattleInfo); yield return(new WaitForSeconds(1f)); } } }
protected override void Initialize() { debugDrawTimeStopwatch = new Stopwatch(); // Window.IsBorderless = false; Data.SetSettings(); ScreenController.graphicsDevice = GraphicsDevice; DisplayController.Init(this); EngineController.Init(); GraphicsManager.Init(Content); AudioManager.Init(Content); //Game specific init. this could probably be done in game load GroundLayerController.Init(); AngleStuff.Init(); PieceController.Init(); ShadowSpriteController.Init(); MapObjectController.Init(); TileLogisticsController.Init(); GraphicsDevice.Clear(Color.White); IsMouseVisible = true; base.Initialize(); ScreenController.ChangeScreen(new MenuMain()); }