Exemple #1
0
        private void CreatExpressions()
        {
            if (GameUtil.isCanUseEmoji())
            {
                ExceptionTxt.text = "表情包到期时间:" + CommonUtil.splitStr_Start_str(PlayerInfoComponent.Instance.GetPlayerInfo().EmogiTime, ' ');
            }
            else
            {
                ExceptionTxt.text = "";
            }

            ExpressionBtn.transform.GetChild(0).gameObject.SetActive(true);
            ShortBtn.transform.GetChild(0).gameObject.SetActive(false);
            GameObject obj = null;

            for (int i = 0; i < 18; ++i)
            {
                if (i < ExpressionItemList.Count)
                {
                    obj = ExpressionItemList[i];
                }
                else
                {
                    obj = GameObject.Instantiate(ExpressionItem);
                    obj.transform.SetParent(ExpressionGrid.transform);
                    obj.transform.localScale    = Vector3.one;
                    obj.transform.localPosition = Vector3.zero;
                    ExpressionItemList.Add(obj);
                    UI ui = ComponentFactory.Create <UI, GameObject>(obj);
                    ui.AddComponent <UIExpressionComponent>();
                    uiList.Add(ui);
                }
                uiList[i].GetComponent <UIExpressionComponent>().SetExpression(i + 1);
            }
        }
Exemple #2
0
        public void Awake()
        {
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            UIExpression = rc.Get <GameObject>("UIExpression");

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            UIExpression.GetComponent <Button>().onClick.Add(() =>
            {
                if (GameUtil.isCanUseEmoji())
                {
                    RequestChat();
                }
                else
                {
                    ToastScript.createToast("不能发送动态表情,请去商店购买表情包");
                }
            });
        }