private IEnumerator ChangeScene() { GameUiChanger.ChangePosition(playButton.GetComponent <RectTransform>(), new Vector2(1000, 38), 0.7f); GameUiChanger.ChangePosition(welcomeText.GetComponent <RectTransform>(), new Vector2(-1000, 65), 0.7f); yield return(new WaitForSeconds(1f)); SceneManager.LoadScene(1); }
public static void UndoMatch(int n, int block1, int block2, float time) { var p1 = TranslateTablePositionToVector2(block1 / 7, block1 % 7); var p2 = TranslateTablePositionToVector2(block2 / 7, block2 % 7); var p3 = new Vector2 { x = (3 * p1.x + p2.x) / 4, y = (3 * p1.y + p2.y) / 4 }; GameUiChanger.ChangePosition(Line[n], p3, time); Destroy(Line[n], 0.1f); }
public static void Match(int n, int block1, int block2, float time) { Line[n] = FindObjectOfType <GameUiCreator>().CreateLine(_parent); var p1 = TranslateTablePositionToVector2(block1 / 7, block1 % 7); var p2 = TranslateTablePositionToVector2(block2 / 7, block2 % 7); var p3 = new Vector2 { x = (p1.x + p2.x) / 2, y = (p1.y + p2.y) / 2 }; var p4 = new Vector2 { x = (p3.x + p1.x) / 2, y = (p3.y + p1.y) / 2 }; GameUiChanger.SetPosition(Line[n], p4); GameUiChanger.ChangePosition(Line[n], p3, time); }
public static void Move(BlockData block, int x, int y, float time) { var z = TranslateTablePositionToVector2(x, y); GameUiChanger.ChangePosition(block.rectTransform, z, time); }