コード例 #1
0
        void Start()
        {
            base.listener = GameObject.Find("Canvas").GetComponent <Listener>();
            //base.userName.text = "Computer";
            DiceHolder.SetActive(true);
            TimerBg.SetActive(false);
            ChatBox.SetActive(false);
            Emoji.SetActive(false);
            //showArrow.SetActive (false);
            //base.setColor (LudoColor.Yellow);
            for (int i = 0; i < base.goti.Length; i++)
            {
                base.goti[i].GetComponent <GotiScript>().playerName = base.Player_ID;
                base.goti[i].GetComponent <GotiScript>().index      = i + 1;
                //	base.goti [i].SetActive (false);
            }

            if (PlayerImageUrl.Length != 0)
            {
                if (PlayerImageUrl.Contains("AVTAR"))
                {
                    string[] img = PlayerImageUrl.Split(new string[] { "-" }, System.StringSplitOptions.None);
                    base.Image.sprite = Resources.Load <Sprite>("Avtar/" + img[1]);
                }
                else
                {
                    StartCoroutine(loadImage(PlayerImageUrl));
                }
            }
            else
            {
                // Debug.Log ("profilePic null");
                base.Image.sprite = Resources.Load <Sprite>("images/user-default");
            }

            base.color = LudoColor.Yellow;
            base.updateData();
        }
コード例 #2
0
        void Start()
        {
            base.listener = GameObject.Find("Canvas").GetComponent <Listener>();
            DiceHolder.SetActive(true);
            showArrow.SetActive(false);
            TimerBg.SetActive(false);
            ChatBox.SetActive(false);
            ChatPanel.SetActive(false);
            EmojiPanel.SetActive(false);
            ClosePanel.SetActive(false);

            EmojiBtn.SetActive(false);
            ChatBtn.SetActive(false);
            Emoji.SetActive(false);

            DiceBtn.GetComponent <Button>().onClick.AddListener(TapDiceAction);
            ChatBtn.GetComponent <Button>().onClick.AddListener(startChatting);
            EmojiBtn.GetComponent <Button>().onClick.AddListener(SendEmoji);
            ClosePanel.GetComponent <Button>().onClick.AddListener(HideChatPanel);

            if (GameConstantData.GameType != GameConstantData.Practice)
            {
                ChatBtn.SetActive(true);
                EmojiBtn.SetActive(true);
            }



            base.setColor(LudoColor.Red);
            //base.userName.text = UserController.getInstance.Name;

            try
            {
                if (UserController.getInstance.Name.Length != 0)
                {
                    string capsName = UppercaseFirst(UserController.getInstance.Name);
                    base.userName.text = capsName;
                }
            }
            catch (System.Exception ex)
            {
                // Debug.Log (ex.Message);
            }

            string playerImage = UserController.getInstance.Image;

            if (playerImage.Length != 0)
            {
                if (playerImage.Contains("AVTAR"))
                {
                    string[] img = playerImage.Split(new string[] { "-" }, System.StringSplitOptions.None);
                    // Debug.Log ("bdhvhjbds jndscjn "+img [1]);
                    base.Image.sprite = Resources.Load <Sprite>("Avtar/" + img[1]);
                }
                else
                {
                    StartCoroutine(loadImage(playerImage));
                }
            }
            else
            {
                // Debug.Log ("profilePic null");
                base.Image.sprite = Resources.Load <Sprite>("images/user-default");
            }
            for (int i = 0; i < base.goti.Length; i++)
            {
                base.goti[i].GetComponent <GotiScript>().playerName = UserController.getInstance.ID;
                base.goti[i].GetComponent <GotiScript>().index      = i + 1;
                base.goti[i].SetActive(false);
            }

            //diceSample = GameObject.FindGameObjectsWithTag ("redDices");


            base.color = LudoColor.Red;
            base.updateData();
            // StartCoroutine(sendData());
        }