Exemplo n.º 1
0
        /// <exclude />
        public static FluentTagBuilder GenerateShieldMarkup(string subject, ShieldType? type = null, string status = null, ShieldColor color = ShieldColor.Green, ShieldStyle style = ShieldStyle.Flat, ShieldImage image = ShieldImage.Png)
        {
            string url;
            subject = subject.Split(' ')[0];
            if (type == null)
                url = Substitute("https://img.shields.io/badge/{subject}-{status}-{color}.{image}", subject.Replace("-", ""), status, color, image, style);
            else
                url = Substitute(GithubForkmeMask[(ShieldType)type], subject, status, color, image, style);

            return new FluentTagBuilder().Tag("img", null, new { src = url });
        }
Exemplo n.º 2
0
 /// <exclude />
 private static string Substitute(string url, string subject, string status, ShieldColor? color, ShieldImage? image, ShieldStyle? style)
 {
     var newUrl = url
         .Replace("{subject}", subject as string)
         .Replace("{status}", status as string)
         .Replace("{color}", color.ToStr())
         .Replace("{image}", image.ToStr());
     if (style != ShieldStyle.Flat)
         newUrl += string.Format("?style={0}", style.ToStr());
     return newUrl;
 }
Exemplo n.º 3
0
 void MakeShieldMap()
 {
     foreach (var direction in GameUtility.Directions)
     {
         if (Physics.Raycast(transform.position + _shield.halfShieldVector, direction, checkRange, LayerMask.GetMask("Obstacle")))
         {
             if (Physics.Raycast(transform.position + _shield.perfectShieldVector, direction, checkRange, LayerMask.GetMask("Obstacle")))
             {
                 this.shieldStyle = ShieldStyle.PerfectShield;
             }
             else
             {
                 this.shieldStyle = ShieldStyle.HalfShield;
             }
         }
     }
 }