Пример #1
0
 public static Vector3Target AddToLocalScale(GameObject gameObject, Func <Vector3> getNewValue, float speed = 1f,
                                             TargetCurve curve = TargetCurve.Linear)
 {
     return(AddTo(
                gameObject,
                v => gameObject.transform.localScale = v,
                () => gameObject.transform.localScale,
                getNewValue,
                speed,
                curve
                ));
 }
Пример #2
0
 public static FloatTarget AddToImageFillAmount(Image image, Func <float> getNewValue, float speed = 1f,
                                                TargetCurve curve = TargetCurve.Linear)
 {
     return(AddTo(
                image.gameObject,
                f => image.fillAmount = f,
                () => image.fillAmount,
                getNewValue,
                speed,
                curve
                ));
 }
Пример #3
0
        public static Vector3Target AddTo(GameObject gameObject, Action <Vector3> assignValue,
                                          Func <Vector3> getCurrentValue, Func <Vector3> getNewValue, float speed = 1f,
                                          TargetCurve curve = TargetCurve.Linear)
        {
            var result = gameObject.AddComponent <Vector3Target>();

            result._assignValue     = assignValue;
            result._getCurrentValue = getCurrentValue;
            result._getNewValue     = getNewValue;
            result._speed           = speed;
            result._curve           = curve;
            return(result);
        }
Пример #4
0
 public static ColorTarget AddToImageColor(Image image, Func <Color> getNewValue, float speed = 1f,
                                           TargetCurve curve = TargetCurve.Linear)
 {
     return(AddTo(image.gameObject, v => image.color = v, () => image.color, getNewValue, speed, curve));
 }
Пример #5
0
 public static ColorTarget AddToTextGUIColor(TextMeshProUGUI text, Func <Color> getNewValue, float speed = 1f,
                                             TargetCurve curve = TargetCurve.Linear)
 {
     return(AddTo(text.gameObject, v => text.color = v, () => text.color, getNewValue, speed, curve));
 }