Example #1
0
 public void InitExpressionGroup()
 {
     for (int i = 1; i <= ExpressionAnimPool._ExpressionAnimCount; i++)
     {
         ExpressionAnim    anim       = ExpressionAnimPool.Ins.Create(i, mExpressionGroupGo.transform);
         ChatBtnClickEvent clickEvent = new ChatBtnClickEvent(i.ToString(), ChatType.NormalExpression, this);
         anim.gameObject.AddComponent <Button>().Add(clickEvent.ClickEvent, false);
         _ExpressionAnims.Add(anim);
     }
 }
Example #2
0
 //显示表情
 public void ShowExpression(int expressionIndex)
 {
     if (_expressionAnim != null)
     {
         _expressionAnim.Destroy();
         _expressionAnim = null;
     }
     _expressionAnim = ExpressionAnimPool.Ins.Create(expressionIndex, _ExpressionPoint);
     _expressionAnim.LocalPositionZero();
     DelayActionTool.ExecuteDelayAction(DelayActionId.ChatExpressionHide + _Player.ClientSeatIndex, 5000, HideExpression);
 }
Example #3
0
        public ExpressionAnim Create(int expressionIndex, Transform expressionParent)
        {
            ExpressionAnim expressionAnim;

            if (_ExpressionAnims.Count > 0)
            {
                expressionAnim = _ExpressionAnims[0];
                _ExpressionAnims.RemoveAt(0);
                expressionAnim.Show(_expressionSpriteDic[expressionIndex]);
                expressionAnim.SetParent(expressionParent);
                return(expressionAnim);
            }
            expressionAnim = new ExpressionAnim();
            GameObject expressionAnimGo = GameObject.Instantiate(_ExpressionAnimGoPrefab, expressionParent);

            expressionAnim.Init(expressionAnimGo.GetComponent <Image>(), _expressionSpriteDic[expressionIndex]);
            return(expressionAnim);
        }
Example #4
0
 //隐藏表情
 public void HideExpression()
 {
     _expressionAnim.Destroy();
     _expressionAnim = null;
 }
Example #5
0
 public void DestroyExpression(ExpressionAnim expressionAnim)
 {
     _ExpressionAnims.Add(expressionAnim);
 }