Esempio n. 1
0
    public static void DrawSphere(this MonoBehaviour caller, Vector3 position, float time = 1, float radius = 1f, Color color = new Color())
    {
        if (color.r <= 0.1 && color.g <= 0.1 && color.b <= 0.1 && color.a <= 0.1) // new color
            color = Color.green;

        var s = DebugSphere(position, radius, color);
        caller.After(time, () =>
        {
            Object.Destroy(s);
        });
    }
Esempio n. 2
0
 public static string ReplaceFirstWord(this string line, string firstWord)
 {
     return firstWord + " " +  line.After(" ");
 }
Esempio n. 3
0
 public static string After(this string s, string word)
 {
     return s.After(word, false);
 }
Esempio n. 4
0
 public static bool StartsWithAny(this string s, IEnumerable<string> starts, out string rem)
 {
     foreach (string start in starts)
         if (s.StartsWith(start))
         {
             rem = s.After(start);
             return true;
         }
     rem = null;
     return false;
 }
Esempio n. 5
0
 public static string After(this string s, string after)
 {
     return s.After(after, StringComparison.CurrentCulture);
 }
 // Apply CoffeeScript processing to the bale after concatenation and
 // render as JavaScript
 public static string AsCoffeeScript(this IBale bale)
 {
     return bale.After(CoffeeScriptProcessor.Process).AsJs();
 }
 public static string Between(this String str, string before, string after, int startIndex)
 {
     string afterPart = str.After(before, startIndex);
     return (afterPart == null) ? null : afterPart.Before(after, startIndex);
 }