Exemplo n.º 1
0
        /// <summary>
        /// Button press for clear scene confirmation
        /// </summary>
        public void OnClearGameClick()
        {
            AudioManager.Instance.PlayAudioClip("Reset");

            GameManager.Instance.RestartGame();

            if (MenuControllerUI != null)
            {
                MenuControllerUI.SetMenuList();
            }

            clearButton.SetActive(false);
            resetButton.SetActive(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Confirms item placement
        /// </summary>
        public void PlaceObject()
        {
            AudioManager.Instance.PlayAudioClip("ObjectSelection");

            PlacementManager.Instance.PlaceObject();
            SelectionManager.Instance.UnselectObject();

            if (MenuControllerUI != null)
            {
                MenuControllerUI.SetMenuList();
            }

            UpdateObjectsCounter();

            ReorderTextureMenu();

            GameManager.Instance.GameOver(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// The ball spawn button press
        /// </summary>
        public void OnSpawnBallClick(int id)
        {
            if (PlacementManager.Instance.HasHitPoint)
            {
                ObjectManager.Instance.SpawnBall(0);

                if (MenuControllerUI != null)
                {
                    MenuControllerUI.SetMenuPlacement(-1);
                }

                SetPlayButtonState(PlayButtonState.Play);

                PopUpManager.Instance.CloseAll();
            }
            else
            {
                AudioManager.Instance.PlayAudioClip("HelpClose");
                Debug.Log("No Target Position");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Deletes item from scene
        /// </summary>
        public void CancelPlacement()
        {
            AudioManager.Instance.PlayAudioClip("Reset");

            if (MenuControllerUI != null)
            {
                if (SelectionManager.Instance.SelectedObject.IsPhysic)
                {
                    MenuControllerUI.ResetBall();
                }

                PlacementManager.Instance.DeleteObject();

                MenuControllerUI.SetMenuList();
            }

            UpdateObjectsCounter();
            ReorderTextureMenu();

            GameManager.Instance.GameOver(false);
        }
Exemplo n.º 5
0
        /// <summary>
        /// List menu item selection
        /// </summary>
        public void OnItemClick(int id)
        {
            if (PlacementManager.Instance.HasHitPoint && PlacementManager.Instance.InSceneObjectsCount < PlacementManager.Instance.MaxObjectsInScene)
            {
                ObjectManager.Instance.SpawnObject(id);

                if (MenuControllerUI != null)
                {
                    MenuControllerUI.SetMenuPlacement(id);
                }

                PlacementManager.Instance.InSceneObjectsCount++;
                PopUpManager.Instance.CloseAll();

                DOTween.Kill("timer");
            }
            else
            {
                AudioManager.Instance.PlayAudioClip("HelpClose");
                Debug.Log("No Target Position");
            }
        }