Example #1
0
 public void numberSelection(GameObject btn)
 {
     try
     {
         int number = int.Parse(btn.transform.GetChild(0).GetComponent <Text>().text);
         GameDelegate.stopAnimation();
         GameDelegate.selectNumber(number);
         this.onHideButtonPanel();
         appwarp.userSelectGoti(this.GotiNumber, number);
         GameDelegate.StartDisableAllGoti();
     }
     catch (System.Exception ex)
     {
         // Debug.Log (ex.Message);
     }
 }
Example #2
0
 public void numberSelection(GameObject btn)
 {
     try
     {
         int number = int.Parse(btn.transform.GetChild(0).GetComponent <Text>().text);
         GameDelegate.stopAnimation();
         GameDelegate.selectNumber(number);
         appwarp.userSelectGoti(index, number);
         Enable = false;
         removeOption();
         GameDelegate.StartDisableAllGoti();
     }
     catch (System.Exception ex)
     {
         // Debug.Log (ex.Message);
     }
 }
Example #3
0
        public void TapGotiAction()
        {
            GameDelegate.hideButton();

            if (Enable)
            {
                GameDelegate.hideGotipanel();
                if (playerName == UserController.getInstance.ID)
                {
                    //// Debug.Log (" value is " + TurnValue.Count);
                    // Debug.Log (" value is " + TurnValue.ToString ());
                    if (TurnValue.Count > 1)
                    {
                        //removeOption ();
                        // Debug.Log ("Multiple Values ");
                        if (currentPosition == -1)
                        {
                            // Debug.Log ("Click on House goti");
                            if (userHasOne() && userHasSix())
                            {
                                GameDelegate.showButton(TurnValue, transform.gameObject);
                                // Debug.Log("call showButton");
                                //							Panel.SetActive (true);
                                //							Indicator.SetActive (true);
                                //							for (int i = 0; i < TurnValue.Count; i++) {
                                //								Button [i].SetActive (true);
                                //								Button [i].transform.GetChild (0).GetComponent<Text> ().text = TurnValue [i];
                                //							}
                            }
                            else
                            {
                                if (userHasSix())
                                {
                                    GameDelegate.stopAnimation();
                                    Enable = false;
                                    GameDelegate.showRemoveNumber(6);
                                    GameDelegate.selectNumber(6);
                                    appwarp.userSelectGoti(index, 6);
                                    // Debug.Log (" You have 6 ");
                                }
                                else if (userHasOne())
                                {
                                    GameDelegate.stopAnimation();
                                    GameDelegate.showRemoveNumber(1);
                                    GameDelegate.selectNumber(1);
                                    appwarp.userSelectGoti(index, 1);
                                    Enable = false;
                                    // Debug.Log (" You have 1 ");
                                }
                            }
                        }
                        else
                        {
                            //						GameDelegate.hideGotipanel ();
                            // Debug.Log ("Click on running goti. Show PopUp");

                            GameDelegate.showButton(TurnValue, transform.gameObject);
                            //						Panel.SetActive (true);
                            //
                            //						Indicator.SetActive (true);
                            //						for (int i = 0; i < TurnValue.Count; i++) {
                            //							Button [i].SetActive (true);
                            //							Button [i].transform.GetChild (0).GetComponent<Text> ().text = TurnValue [i];
                            //						}
                        }
                    }
                    else if (TurnValue.Count == 1)
                    {
                        // Debug.Log ("Have single value");
                        int number = int.Parse(TurnValue[0]);

                        if (currentPosition == -1)
                        {
                            if (number == 6 || number == 1)
                            {
                                GameDelegate.stopAnimation();
                            }
                            GameDelegate.selectNumber(number);
                            appwarp.userSelectGoti(index, number);
                            Enable = false;
                        }
                        if (currentPosition != -1)
                        {
                            GameDelegate.stopAnimation();
                            GameDelegate.selectNumber(number);
                            appwarp.userSelectGoti(index, number);
                            Enable = false;
                        }
                    }

                    // Debug.Log (" value is " + TurnValue.Count);
                    animator.GetComponent <Animation>().Stop();
                    animator.SetActive(false);
                    //print ("Tap on working " + index);
                }
            }
            else
            {
                // Debug.Log ("is not enable");
            }
        }