Exemplo n.º 1
0
    public QueueEventPosition(GameObject element, Vector3 starting_val, Vector3 ending_val, float position_time,
                              EasingFunctionsType movement_type, bool real_time = false) : base("scale")
    {
        this.movement_type    = movement_type;
        this.affected_element = element;
        this.starting_val     = starting_val;
        this.ending_val       = ending_val;
        this.real_time        = real_time;
        this.position_time    = position_time;

        val_difference = ending_val - starting_val;
    }
    public QueueEventFade(GameObject element, float starting_val, float ending_val, float fade_time,
                          EasingFunctionsType movement_type, bool real_time = false) : base("fade")
    {
        this.movement_type    = movement_type;
        this.affected_element = element;
        this.starting_val     = starting_val;
        this.ending_val       = ending_val;
        this.real_time        = real_time;
        this.fade_time        = fade_time;

        val_difference = ending_val - starting_val;
    }
Exemplo n.º 3
0
    public static float GetEasing(EasingFunctionsType type, float total_value, float current_time, float starting_value, float total_duration)
    {
        float ret = 0.0f;

        switch (type)
        {
        case EasingFunctionsType.LINEAR:
            ret = Linear(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.EXPO_IN:
            ret = ExpoIn(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.EXPO_OUT:
            ret = ExpoOut(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.EXPO_IN_OUT:
            ret = ExpoInOut(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.BOUNCE:
            ret = Bounce(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.QUAD_IN:
            ret = QuadIn(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.QUAD_OUT:
            ret = QuadOut(total_value, current_time, starting_value, total_duration);
            break;

        case EasingFunctionsType.QUAD_IN_OUT:
            ret = QuadInOut(total_value, current_time, starting_value, total_duration);
            break;
        }

        return(ret);
    }