コード例 #1
0
ファイル: StringExtensions.cs プロジェクト: stoning-code/LBON
        public static string Mask(this string str, int numExposed, char maskChar = '*', MaskTypeEnum type = MaskTypeEnum.All)
        {
            var maskedString = str;

            if (str.IsLengthAtLeast(numExposed))
            {
                var builder = new StringBuilder(str.Length);
                int index   = maskedString.Length - numExposed;

                if (type == MaskTypeEnum.AlphaNumericOnly)
                {
                    CreateAlphaNumMask(builder, str, maskChar, index);
                }
                else
                {
                    builder.Append(maskChar, index);
                }

                builder.Append(str.Substring(index));
                maskedString = builder.ToString();
            }

            return(maskedString);
        }
コード例 #2
0
 protected virtual void Reset()
 {
     maskType = MaskTypeEnum.Exclusive;
     mask     = LayerMask.GetMask("Ignore Raycast");
 }
コード例 #3
0
 protected override void OnEnable()
 {
     base.OnEnable();
     maskType = MaskTypeEnum.Exclusive;
     mask     = LayerMask.GetMask("Ignore Raycast");
 }