Vector3 UpdateMoveArc(Vector3 posFrom, Vector3 posTo, float arcHeight, float t, Easing.Ease easing)
    {
        Vector3 pos = Vector3.Lerp(posFrom, posTo, Easing.EaseResult(easing, 0f, 1f, t));

        pos.y += arcHeight * Mathf.Sin(Mathf.Clamp01(Easing.EaseResult(easing, 0f, 1f, t)) * Mathf.PI);
        return(pos);
    }
Exemple #2
0
    public void ColorToMaterial(Material material, Color colTo, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type             = TaskType.colorMaterial;
        task.data["material"] = material;
        task.data["from"]     = material.color;
        task.data["to"]       = colTo;
        tasks.Add(task);
    }
Exemple #3
0
    public void ScaleTo(Transform obj, Vector3 scaleTo, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.scale;
        task.data["transform"] = obj;
        task.data["from"]      = obj.localScale;
        task.data["to"]        = scaleTo;
        tasks.Add(task);
    }
Exemple #4
0
    public void MoveToLocal(Transform obj, Vector3 posTo, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.moveLocal;
        task.data["transform"] = obj;
        task.data["from"]      = obj.localPosition;
        task.data["to"]        = posTo;
        tasks.Add(task);
    }
Exemple #5
0
    public void ColorToSprite(SpriteRenderer sprite, Color colTo, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type           = TaskType.colorSprite;
        task.data["sprite"] = sprite;
        task.data["from"]   = sprite.color;
        task.data["to"]     = colTo;
        tasks.Add(task);
    }
Exemple #6
0
    public void RotateToLocal(Transform obj, Quaternion rotTo, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.rotateLocal;
        task.data["transform"] = obj;
        task.data["from"]      = obj.localRotation;
        task.data["to"]        = rotTo;
        tasks.Add(task);
    }
Exemple #7
0
    public void MoveArcTo(Transform obj, Vector3 posTo, float arcHeight, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.moveArc;
        task.data["transform"] = obj;
        task.data["from"]      = obj.position;
        task.data["to"]        = posTo;
        task.data["arcHeight"] = arcHeight;
        tasks.Add(task);
    }
 Task AddTask(float time, Easing.Ease easing)
 {
     return(new Task()
     {
         t = 0f,
         time = 0f,
         goalTime = time,
         easing = easing,
         data = new Hashtable()
     });
 }
    public Task ColorToMaterial(Material material, Color colTo, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type             = TaskType.colorMaterial;
        task.data["material"] = material;
        task.data["from"]     = material.color;
        task.data["to"]       = colTo;
        task.callback         = callback;
        tasks.Add(task);
        return(task);
    }
    public Task RotateToLocal(Transform obj, Quaternion rotTo, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.rotateLocal;
        task.data["transform"] = obj;
        task.data["from"]      = obj.localRotation;
        task.data["to"]        = rotTo;
        task.callback          = callback;
        tasks.Add(task);
        return(task);
    }
    public Task ScaleTo(Transform obj, Vector3 scaleTo, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.scale;
        task.data["transform"] = obj;
        task.data["from"]      = obj.localScale;
        task.data["to"]        = scaleTo;
        task.callback          = callback;
        tasks.Add(task);
        return(task);
    }
    public Task ColorToSprite(SpriteRenderer sprite, Color colTo, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type           = TaskType.colorSprite;
        task.data["sprite"] = sprite;
        task.data["from"]   = sprite.color;
        task.data["to"]     = colTo;
        task.callback       = callback;
        tasks.Add(task);
        return(task);
    }
    public Task MoveToLocal(Transform obj, Vector3 posTo, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.moveLocal;
        task.data["transform"] = obj;
        task.data["from"]      = obj.localPosition;
        task.data["to"]        = posTo;
        task.callback          = callback;
        tasks.Add(task);
        return(task);
    }
    public Task MoveArcTo(Transform obj, Vector3 posTo, float arcHeight, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type = TaskType.moveArc;
        task.data["transform"] = obj;
        task.data["from"]      = obj.position;
        task.data["to"]        = posTo;
        task.data["arcHeight"] = arcHeight;
        task.callback          = callback;
        tasks.Add(task);
        return(task);
    }
Exemple #15
0
    public void ActionFloat(System.Action <float> action, float from, float to, float time, Easing.Ease easing)
    {
        Task task = AddTask(time, easing);

        task.type           = TaskType.actionFloat;
        task.data["action"] = action;
        task.data["from"]   = from;
        task.data["to"]     = to;
        tasks.Add(task);
    }
 Color UpdateColor(Color colFrom, Color colTo, float t, Easing.Ease easing)
 {
     return(Color.Lerp(colFrom, colTo, Easing.EaseResult(easing, 0f, 1f, t)));
 }
 Quaternion UpdateRotate(Quaternion rotFrom, Quaternion rotTo, float t, Easing.Ease easing)
 {
     return(Quaternion.Lerp(rotFrom, rotTo, Easing.EaseResult(easing, 0f, 1f, t)));
 }
 Vector3 UpdateScale(Vector3 scaleFrom, Vector3 scaleTo, float t, Easing.Ease easing)
 {
     return(Vector3.Lerp(scaleFrom, scaleTo, Easing.EaseResult(easing, 0f, 1f, t)));
 }
    public Task ActionFloat(System.Action <float> action, float from, float to, float time, Easing.Ease easing, System.Action callback = null)
    {
        Task task = AddTask(time, easing);

        task.type           = TaskType.actionFloat;
        task.data["action"] = action;
        task.data["from"]   = from;
        task.data["to"]     = to;
        task.callback       = callback;
        tasks.Add(task);
        return(task);
    }
 Vector3 UpdateMove(Vector3 posFrom, Vector3 posTo, float t, Easing.Ease easing)
 {
     return(Vector3.Lerp(posFrom, posTo, Easing.EaseResult(easing, 0f, 1f, t)));
 }