public void Enter() { tetrisController = MonoBehaviour.FindObjectOfType <TetrisController>(); gameUIController = MonoBehaviour.FindObjectOfType <InGameUIController>(); tetrisController.Init(); gameUIController.Init(StoreManager.Instance); tetrisController.OnFinished = () => { // TODO: データの保存 SceneManager.LoadScene("Result"); }; // シーン遷移後にステートを変更 SceneManager.activeSceneChanged += OnSceneChanged; gameUIController.OnPaused = () => { }; gameUIController.OnInGamed = () => { }; gameUIController.OnTitled = () => { }; }
public void updateGrid(TetrisController t) { //remove old tetris from game for (int y = 0; y < gridHeight; ++y) { for (int x = 0; x < gridWidth; ++x) { if (grid[x, y] != null) { if (grid[x, y].parent == t.transform) { grid[x, y] = null; } } } } foreach (Transform tetris in t.transform) { Vector2 position = Round(tetris.position); if (position.y < gridHeight && position.x < gridWidth) { grid [(int)position.x, (int)position.y] = tetris; } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Application.Run(new Form1()); TetrisController controller = new TetrisController(); //controller.start(); }
void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); return; } _instance = this; }
public bool checkIsAtTop(TetrisController t) { Debug.Log("TOP Position : " + t.transform.position.y); for (int i = 0; i < gridWidth; ++i) { foreach (Transform tetris in t.transform) { Vector2 pos = Round(tetris.position); if (pos.y > gridHeight - 1) { return(true); } } } return(false); }
public TetrisModel(TetrisController controller, TetrisView view) { this.controller = controller; this.view = view; current_block = new TetrisBlock(); }
static void Main() { TetrisController gioco = new TetrisController(); gioco.Inizia(); }
// Start is called before the first frame update void Awake() { tetrisController = FindObjectOfType <TetrisController>(); tetrisBoard = tetrisController.GetComponent <Transform>(); }