Example #1
0
        // Commands shared by DOStartup/ChangeStart/End/Values if the tween has already started up
        // and thus some settings needs to be reapplied.
        // Returns TRUE in case of SUCCESS, FALSE if there were managed errors
        static bool DOStartupSpecials <T1, T2, TPlugOptions>(TweenerCore <T1, T2, TPlugOptions> t) where TPlugOptions : struct
        {
            switch (t.specialStartupMode)
            {
            case SpecialStartupMode.SetLookAt:
                if (!SpecialPluginsUtils.SetLookAt(t as TweenerCore <Quaternion, Vector3, QuaternionOptions>))
                {
                    return(false);
                }
                break;

            case SpecialStartupMode.SetPunch:
                if (!SpecialPluginsUtils.SetPunch(t as TweenerCore <Vector3, Vector3[], Vector3ArrayOptions>))
                {
                    return(false);
                }
                break;

            case SpecialStartupMode.SetShake:
                if (!SpecialPluginsUtils.SetShake(t as TweenerCore <Vector3, Vector3[], Vector3ArrayOptions>))
                {
                    return(false);
                }
                break;

            case SpecialStartupMode.SetCameraShakePosition:
                if (!SpecialPluginsUtils.SetCameraShakePosition(t as TweenerCore <Vector3, Vector3[], Vector3ArrayOptions>))
                {
                    return(false);
                }
                break;
            }
            return(true);
        }
Example #2
0
        // Commands shared by DOStartup/ChangeStart/End/Values if the tween has already started up
        // and thus some settings needs to be reapplied.
        // Returns TRUE in case of SUCCESS, FALSE if there were managed errors
        static bool DOStartupSpecials <T1, T2, TPlugOptions>(TweenerCore <T1, T2, TPlugOptions> t) where TPlugOptions : struct, IPlugOptions
        {
            try {
                switch (t.specialStartupMode)
                {
                case SpecialStartupMode.SetLookAt:
                    if (!SpecialPluginsUtils.SetLookAt(t as TweenerCore <DOQuaternion, DOVector3, QuaternionOptions>))
                    {
                        return(false);
                    }
                    break;

                case SpecialStartupMode.SetPunch:
                    if (!SpecialPluginsUtils.SetPunch(t as TweenerCore <Vector3, Vector3[], Vector3ArrayOptions>))
                    {
                        return(false);
                    }
                    break;

                case SpecialStartupMode.SetShake:
                    if (!SpecialPluginsUtils.SetShake(t as TweenerCore <Vector3, Vector3[], Vector3ArrayOptions>))
                    {
                        return(false);
                    }
                    break;

                case SpecialStartupMode.SetCameraShakePosition:
                    if (!SpecialPluginsUtils.SetCameraShakePosition(t as TweenerCore <Vector3, Vector3[], Vector3ArrayOptions>))
                    {
                        return(false);
                    }
                    break;
                }
                return(true);
            } catch {
                // Error in SpecialPluginUtils (usually due to target being destroyed)
                return(false);
            }
        }