示例#1
0
 public void AboutButton_Click()
 {
     if (MGui)
     {
         MGui.ShowAbout();
     }
 }
示例#2
0
        void Start()
        {
            if (gMode == GameMode.Edit)
            {
                Debug.Log("start edit mode");
#if UNITY_EDITOR
                CreateGameBoard(true);
                gConstructor.GetComponent <GameConstructor>().InitStart();
                if (anchor)
                {
                    anchor.gameObject.SetActive(false);
                }
#endif
            }

            else if (gMode == GameMode.Play)
            {
                Debug.Log("start play mode");
                CreateGameBoard(true);
                if (gConstructor)
                {
                    DestroyImmediate(gConstructor.gameObject);
                }
                BubblesShooter.Instance.InitStart(minBubbleScore, maxBubbleScore);
                MPlayer.SetAverageScore(grid.GetObjectCountWithScore() * (minBubbleScore + maxBubbleScore) / 2);
                Debug.Log("AverageScore: " + BubblesPlayer.Instance.AverageScore);
                WController = new WinController(LcSet.levelMission, this, BubblesShooter.Instance,
                                                () =>
                {
                    // BubblesPlayer.Instance.PassLevel();
                    // GuiController.Instance.ShowVictory();// next features
                },
                                                () =>
                {
                    // next features
                    // BubblesPlayer.Instance.AddLifes(-1);
                    // GuiController.Instance.ShowLoss();
                },
                                                () => { if (HeaderGUIController.Instance)
                                                        {
                                                            HeaderGUIController.Instance.RefreshTargets();
                                                        }
                                                },
                                                timeCounter, movesCounter);

                if (showLevelMission)
                {
                    MGui.ShowMission(() => { Debug.Log("close mission"); });
                }
                if (HeaderGUIController.Instance)
                {
                    HeaderGUIController.Instance.Refresh();
                }
            }

            FooterGUIController.Instance.InitStart();
            resultShowed = false;
        }
示例#3
0
        private void Update()
        {
            if (gMode == GameMode.Edit)
            {
                return;
            }
            if (WController == null)
            {
                return;
            }

            if (WController.GameResult == GameResult.Loose && !resultShowed)
            {
                resultShowed = true;
                MPlayer.AddLifes(-1);
                MGui.ShowLoss();
                return;
            }

            if (WController.GameResult == GameResult.Win && !resultShowed)
            {
                resultShowed = true;
                MPlayer.PassLevel();
                MGui.ShowVictory();
                return;
            }

            WController.Update(Time.time);
            if (gState == GameState.Shooting)
            {
                Shooting();
            }
            else if (gState == GameState.DisableTouch)
            {
            }
        }
示例#4
0
 /// <summary>
 /// Show failed purchase message
 /// </summary>
 /// <param name="prodId"></param>
 /// <param name="prodName"></param>
 private void FailedPurchaseMessage(string prodId, string prodName)
 {
     MGui?.ShowMessage("Sorry.", prodName + " - not received.", 3, null);
 }
示例#5
0
 /// <summary>
 /// Show good purchase message
 /// </summary>
 /// <param name="prodId"></param>
 /// <param name="prodName"></param>
 private void GoodPurchaseMessage(string prodId, string prodName)
 {
     MGui?.ShowMessage("Succesfull!!!", prodName + " received successfull.", 3, null);
 }
示例#6
0
        private void Start()
        {
            Debug.Log("Map started");

            // cache biomes
            biomes = new List <Biome>(GetComponentsInChildren <Biome>());
            if (biomes == null)
            {
                Debug.LogError("No  biomes found.");
                return;
            }

            biomes.RemoveAll((b) => { return(b == null); });
            biomes.Reverse();
            biomesCount = biomes.Count;

            content = GetComponent <RectTransform>();
            if (!content)
            {
                Debug.LogError("No RectTransform component. Use RectTransform for MapMaker.");
                return;
            }

            // cache level buttons
            MapLevelButtons = new List <LevelButton>();
            foreach (var b in biomes)
            {
                MapLevelButtons.AddRange(b.levelButtons);
            }

            int topPassedLevel = MPlayer.TopPassedLevel;

            for (int i = 0; i < MapLevelButtons.Count; i++)
            {
                //1 add listeners
                int buttonNumber = i + 1;
                int currLev      = i;

                MapLevelButtons[i].button.onClick.AddListener(() =>
                {
                    MSound.SoundPlayClick(0, null);
                    BubblesPlayer.CurrentLevel = currLev;
                    if (MPlayer.Life <= 0)
                    {
                        MGui.ShowMessage("Sorry!", "You have no lifes.", 1.5f, () => { MGui.ShowLifeShop(); }); return;
                    }
                    Debug.Log("load scene : " + gameSceneOffset + " ;CurrentLevel: " + BubblesPlayer.CurrentLevel);
                    GameBoard.showLevelMission = true;
                    if (SceneLoader.Instance)
                    {
                        SceneLoader.Instance.LoadScene(gameSceneOffset, () => { });
                    }
                });

                // activate buttons
                SetButtonActive(buttonNumber, buttonNumber == topPassedLevel + 2, topPassedLevel + 1 >= buttonNumber);
                MapLevelButtons[i].numberText.text = (buttonNumber).ToString();
            }

            // set fb events
            FBholder.LoadPhotoEvent += SetFBPhoto;
            FBholder.LogoutEvent    += RemoveFBPhoto;

            parentCanvas = GetComponentInParent <Canvas>();
            sRect        = GetComponentInParent <ScrollRect>();
            if (scrollToActiveButton)
            {
                StartCoroutine(SetMapPositionToAciveButton());
            }

            //update photo
            SetFBPhoto(FBholder.IsLogined, FBholder.Instance.playerPhoto);
        }
 public void ShowSettings_Click()
 {
     MGui?.ShowSettings();
 }
 public void ShowRealLifeShop_Click()
 {
     MGui?.ShowLifeShop();
 }
 public void ShowRealCoinsShop_Click()
 {
     MGui?.ShowRealCoinsShop();
 }
示例#10
0
 public void ShowBoosterShop_Click()
 {
     MGui?.ShowInGameShopBooster(null);
 }
示例#11
0
 public void Profile_Click()
 {
     MGui.ShowProfile();
 }
示例#12
0
 /// <summary>
 /// Show failed purchase message
 /// </summary>
 /// <param name="prodId"></param>
 /// <param name="prodName"></param>
 private void FailedPurchaseMessage(string prodId, string prodName)
 {
     MGui.ShowMessage("Sorry.", prodName + " - purchase failed.", 3, null);
 }