示例#1
0
    public override void Hide(float duration, bool performTransition = true)
    {
        Cinematron.ducTime(1.0f, duration, iTween.EaseType.easeOutCubic, true);
        base.Hide(duration, performTransition);

        if (windTracker != null)
        {
            windTracker.ignoreTimescale = false;
        }
    }
 public override void Show(float duration, bool performTransition = true)
 {
     Cinematron.ducTime(ducTimeScale, duration, iTween.EaseType.easeOutCubic, true);
     base.Show(duration, performTransition);
 }
示例#3
0
    public override void Update()
    {
        if (!Running)
        {
            return;
        }

        if (currentPath != null || paths.Length == 0)
        {
            return;
        }

        currentPath = paths[currentIdx];
        if (currentPath == null)
        {
            return;
        }

        activePath = currentPath.name;

        const string id = "worldFeatureCameraPathTween";

        Misc.animate(gameObject, id, 0.0f, PanDuration, PanDuration, true,
                     (Action <object>)((x) =>
        {
            var t      = (float)x;
            var unit_t = Mathf.Clamp01(t / PanDuration);

            GetComponent <Camera>().transform.position      = currentPath.GetPositionOnSpline(unit_t);
            GetComponent <Camera>().transform.localRotation = currentPath.GetOrientationOnSpline(unit_t);

            if (t >= 0 || t <= PanDuration)
            {
                float v = 1.0f;
                if (t < PanFadeDuration)
                {
                    if (performPathFadein == true)
                    {
                        v = rampIn.Evaluate(t / PanFadeDuration);
                        Cinematron.setFade(v);
                    }
                }
                else if (t > (PanDuration - PanFadeDuration))
                {
                    if (transitionOut == true)
                    {
                        t = PanDuration - t;
                        v = rampOut.Evaluate(1.0f - (t / PanFadeDuration));
                        Cinematron.setFade(v);
                    }
                }
            }
        }),
                     (Action <object>)((x) =>
        {
            currentPath = null;
            activePath  = "N/A";
            currentIdx  = (currentIdx + 1) % paths.Length;

            //	The following is to prevent fading twice, when coming from the main(non-feature) loop.
            if (performPathFadein == false)
            {
                performPathFadein = true;
            }
        })
                     );
    }