Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        public static void Move(BlockData block, int x, int y, float time)
        {
            var z = TranslateTablePositionToVector2(x, y);

            GameUiChanger.ChangePosition(block.rectTransform, z, time);
        }