Esempio n. 1
0
        private void Init(GreyType type)
        {
            if (mToos.Count != 0)
            {
                if (type != mGreyType)
                {
                    Clear();
                    mToos.Clear();
                }
            }

            if (mToos.Count == 0)
            {
                mGreyType = type;
                bool IsSpr = FUniversalFunction.IsContainSameType((int)type, (int)GreyType.GT_Sprite);
                if (IsSpr)
                {
                    SpriteRenderer[] sprs = this.gameObject.GetComponentsInChildren <SpriteRenderer>(true);
                    for (int i = 0; i < sprs.Length; i++)
                    {
                        SpriteGrey gr = new SpriteGrey(sprs[i]);
                        mToos.Add(gr);
                    }
                }
                else
                {
                    MaskableGraphic[] maskGraps = this.gameObject.GetComponentsInChildren <MaskableGraphic>(true);
                    for (int i = 0; i < maskGraps.Length; i++)
                    {
                        UIGrey gr = new UIGrey(maskGraps[i]);
                        mToos.Add(gr);
                    }

                    bool GreyButton = FUniversalFunction.IsContainSameType((int)type, (int)GreyType.GT_ForbidButton);
                    if (GreyButton)
                    {
                        Button[] buttons = this.gameObject.GetComponentsInChildren <Button>(true);
                        for (int i = 0; i < buttons.Length; i++)
                        {
                            ButtonGrey gr = new ButtonGrey(buttons[i]);
                            mToos.Add(gr);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 private void PlayGray(int tag, GreyType type, Material mat, Color color)
 {
     Init(type);
     if (mTag == tag)
     {
         return;
     }
     Clear();
     if (mat == null)
     {
         SetDrak(color);
     }
     else
     {
         SetGray(mat);
     }
     mTag = tag;
 }
Esempio n. 3
0
 public void PlayGray(Material mat, GreyType type)
 {
     PlayGray(2, type, mat, Color.white);
 }
Esempio n. 4
0
 public void PlayDrak(Color color, GreyType type)
 {
     PlayGray(1, type, null, color);
 }