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); } } } } }
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; }
public void PlayGray(Material mat, GreyType type) { PlayGray(2, type, mat, Color.white); }
public void PlayDrak(Color color, GreyType type) { PlayGray(1, type, null, color); }