using System; using UnityEngine; using System.Collections; using System.Collections.Generic; using System.ComponentModel; /// /// Utility functions /// public static class Utility { /// /// Bool conversion to int (false=-1, true=1) /// /// /// public static int ToIntSign(this bool val) { return val ? 1 : -1; } /// /// Multiplies the TimeSpan with the given integer /// /// /// /// public static TimeSpan Multiply(this TimeSpan ts, int num) { return TimeSpan.FromTicks(ts.Ticks * num); } /// /// Multiplier the TimeSpan with the given float /// /// /// /// public static TimeSpan Multiply(this TimeSpan ts, float num) { return TimeSpan.FromTicks((long)(ts.Ticks * num)); } }