Esempio n. 1
0
        void FixedUpdate()
        {
            if (isRotateDice)
            {
                try
                {
                    int month = Random.Range(1, ImageController.getInstance.DiceRotation.Length);

                    // PlayerDice.GetComponent<Image>().sprite = Resources.Load<Sprite>("Dices/d-" + month);
                    PlayerDice.GetComponent <Image>().sprite = ImageController.getInstance.DiceRotation[month - 1];
                    PlayerDice.transform.localScale          = new Vector3(1.5f, 1.5f, 1.5f);
                }
                catch (System.Exception ex)
                {
                    // Debug.Log ("FixedUpdate Exception "+ex.Message);
                }

                /*
                 * int index = (Time.deltaTime) % frame.Length;
                 * GameObject g  = frame[index];
                 * GameObject newCell = Instantiate (g);
                 * newCell.transform.SetParent (Container.transform);
                 * newCell.transform.localScale = new Vector3 (1, 1, 1);
                 *
                 * newCell.GetComponent<Image> ().sprite = Resources.Load<Sprite> ("images/dice_" + month);
                 */
            }
        }
Esempio n. 2
0
        //	public void showPlayerProfile(){
        //		// Debug.Log ("showPlayerProfile working");
        //		ProfilePanel.SetActive (true);
        //
        //	}

        IEnumerator stopRotation(int value, JSONNode TurnValue)
        {
            yield return(new WaitForSeconds(0.5f));

            isRotateDice = false;
            try
            {
                PlayerDice.GetComponent <Image>().sprite = ImageController.getInstance.Dice[value - 1];
                //PlayerDice.GetComponent<Image> ().sprite = Resources.Load<Sprite> ("Dices/dice_" + value);
                PlayerDice.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
                PlayerDice.transform.rotation   = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f);
            }
            catch (System.Exception ex)
            {
                // Debug.Log ("stopRotation Exception "+ex.Message);
            }
            base.resetDices();
            // Debug.Log("Opponent "+TurnValue.ToString());
            for (int i = 0; i < TurnValue.Count; i++)
            {
                try
                {
                    diceSample[i].SetActive(true);
                    diceSample[i].GetComponent <DiceSample>().index = int.Parse(TurnValue[i]);
                    diceSample[i].GetComponent <Image>().sprite     = ImageController.getInstance.Dice[int.Parse(TurnValue[i]) - 1];
                }
                catch (System.Exception ex)
                {
                    // Debug.Log(ex.Message);
                }
            }

            //print (" " + base.dicNumber + " Occured");
        }
        void FixedUpdate()
        {
            if (isRotateDice)
            {
                int month = Random.Range(1, ImageController.getInstance.DiceRotation.Length);

                // PlayerDice.GetComponent<Image>().sprite = Resources.Load<Sprite>("Dices/d-" + month);
                PlayerDice.GetComponent <Image>().sprite = ImageController.getInstance.DiceRotation[month - 1];
                PlayerDice.transform.localScale          = new Vector3(1.5f, 1.5f, 1.5f);
            }
        }
        IEnumerator stopRotation()
        {
            yield return(new WaitForSeconds(0.5f));

            isRotateDice = false;
            try
            {
                PlayerDice.GetComponent <Image>().sprite = ImageController.getInstance.Dice[base.dicNumber - 1];
                //PlayerDice.GetComponent<Image> ().sprite = Resources.Load<Sprite> ("Dices/dice_" + base.dicNumber);
                PlayerDice.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
                PlayerDice.transform.rotation   = new Quaternion(0.0f, 0.0f, 0.0f, 0.0f);
            }
            catch (System.Exception ex)
            {
                // Debug.Log (ex.Message);
            }

            //print (" " + base.dicNumber + " Occured");
            appwarp.sendTapDone(base.dicNumber);
        }