public override void OnInspectorGUI() { MinoMovementController script = target as MinoMovementController; base.OnInspectorGUI(); if (GUILayout.Button("ShowGuide")) { script.ShowGuide(); } if (GUILayout.Button("DeleteGuide")) { script.DeleteGuide(); } if (GUILayout.Button("RotateLeft")) { script.RotateClockWise(false); } if (GUILayout.Button("RotateRight")) { script.RotateClockWise(true); } if (GUILayout.Button("Ghost")) { script.Ghost(); } if (GUILayout.Button("GhostDelete")) { script.DeleteGhost(); } }
private void Awake() { movementController = GetComponent <MinoMovementController>(); m_iGridNum = 0; m_iGridCount = 0; foreach (Transform t in transform) { if (t.tag == "Block") { m_iGridNum += 1; t.gameObject.AddComponent <MinoPiece>().OnDestroyed.AddListener(() => { m_iGridCount += 1; if (m_iGridNum <= m_iGridCount) { Destroy(gameObject); } }); } } }