void Start()
    {
        // Disable the VideoPlaybackController to prevent touches through this screen
        mVideoPlaybackController = GetComponent<VideoPlaybackController>();
        if (mVideoPlaybackController != null) mVideoPlaybackController.enabled = false;

        // load and set gui style
        mGUISkin = Resources.Load("UserInterfaceSkin") as GUISkin;
    }
    void Start()
    {
        // Disable the VideoPlaybackController to prevent touches through this screen
        mVideoPlaybackController = GetComponent <VideoPlaybackController>();
        if (mVideoPlaybackController != null)
        {
            mVideoPlaybackController.enabled = false;
        }

        // load and set gui style
        mGUISkin = Resources.Load("UserInterfaceSkin") as GUISkin;
    }
Example #3
0
 void InitVideos()
 {
     if (BassVideo == null)
     {
         if (GameObject.Find("DesmondPlaybackBass") != null)
         {
             BassVideo = GameObject.Find("DesmondPlaybackBass").GetComponent <VideoPlaybackController>();
         }
     }
     if (VibesVideo == null)
     {
         if (GameObject.Find("DesmondPlaybackVibes") != null)
         {
             VibesVideo = GameObject.Find("DesmondPlaybackVibes").GetComponent <VideoPlaybackController>();
         }
     }
 }
Example #4
0
    void Start()
    {
        // Disable the VideoPlaybackController to prevent touches through this screen
        mVideoPlaybackController = GetComponent<VideoPlaybackController>();
        if (mVideoPlaybackController != null) mVideoPlaybackController.enabled = false;

        mButtonStyle = new GUIStyle();

        if (Screen.width > Screen.height)
        {
            // Pick the best text/label size for the screen
            if (Screen.width <= m_smallText.width)
            {
                mText = m_smallText;
                mStartLabel = m_smallStartLabel;

                mButtonStyle.normal.background = m_smallStartLabel;
                mButtonStyle.active.background = m_smallStartLabelPressed;
            }
            else if (Screen.width <= m_mediumText.width)
            {
                mText = m_mediumText;
                mStartLabel = m_mediumStartLabel;

                mButtonStyle.normal.background = m_mediumStartLabel;
                mButtonStyle.active.background = m_mediumStartLabelPressed;
            }
            else
            {
                mText = m_largeText;
                mStartLabel = m_largeStartLabel;

                mButtonStyle.normal.background = m_largeStartLabel;
                mButtonStyle.active.background = m_largeStartLabelPressed;
            }
        }
        else
        {
            // Use the smallest text/label in portrait
            mText = m_smallText;
            mStartLabel = m_smallStartLabel;

            mButtonStyle.normal.background = m_smallStartLabel;
            mButtonStyle.active.background = m_smallStartLabelPressed;
        }

        // The text box should fill the width of the screen
        float textWidth = Screen.width;
        float textHeight = textWidth * (mText.height / (float) mText.width);
        float textMargin = (Screen.height - textHeight) / 2.0f;
        mTextRect = new Rect(0, textMargin, textWidth, textHeight);

        // The start label should fit in the lower right corner of the text box
        float labelMargin = textHeight * 0.05f;
        float labelHeight = textHeight * 0.07f;
        float labelWidth = labelHeight * (mStartLabel.width / (float) mStartLabel.height);
        float y = Screen.height - labelHeight - labelMargin - textMargin;
        float x = Screen.width - labelWidth - labelMargin;
        mStartLabelRect = new Rect(x, y, labelWidth, labelHeight);
    }
Example #5
0
    private void RouteTunnelMidi(Pitch pitch)
    {
        if (TunnelVideoController == null)
        {
            TunnelVideoController = GameObject.Find("TunnelPlayback").GetComponent <VideoPlaybackController>();
            TunnelPlane           = GameObject.Find("TunnelPlane").GetComponent <MeshRenderer>();
        }
        switch (pitch)
        {
        case Pitch.C1:
            // remove everything else

            var paintScene = GameObject.Find("PaintScene");
            if (paintScene != null)
            {
                paintScene.SetActive(false);
            }
            var faceScene = GameObject.Find("FaceScene");
            if (faceScene != null)
            {
                faceScene.SetActive(false);
            }
            var particleScene = GameObject.Find("ParticleScene");
            if (particleScene != null)
            {
                particleScene.SetActive(false);
            }

            // start tunnel
            TunnelVideoController.StartPlayback = true;
            var color = TunnelPlane.material.GetColor("_Color");
            TunnelPlane.material.SetColor("_Color", new Color(color.r, color.g, color.b, 1));
            // preset state for Melody Circles
            if (MelodyCirclesController.Instance != null)
            {
                MelodyCirclesController.Instance.GoToPreset();
            }
            break;

        case Pitch.CSharp1:
            // bring in user on finale outro
            TrackerSceneController.Instance.EnableKinectUpdate = true;
            TrackerSceneController.Instance.EnableUserRender   = true;

            // make sure kinect output quad is fully opaque (white)
            var outputQuad = TrackerSceneController.Instance.OutputQuad.GetComponent <MeshRenderer>();
            outputQuad.material.SetColor("_TintColor", Color.white);

            // and no jordan rotation states
            if (JordanRotator.Instance != null)
            {
                JordanRotator.Instance.YAmount   = 0f;
                JordanRotator.Instance.XAmount   = 0f;
                JordanRotator.Instance.XSpeed    = 0f;
                JordanRotator.Instance.YSpeed    = 0f;
                JordanRotator.Instance.PosAmount = 0f;
            }

            MeshTools.Instance.Noise.NoiseIntensity    = 0.005f;
            MeshTools.Instance.Noise.NewNoiseIntensity = 0.005f;
            MeshTools.Instance.Noise.SmoothingTimes    = 1;
            MeshTools.EnableDesmondAirsticksControl    = false;
            MeshTools.AnimateWireframeAlpha            = false;

            UserMesh.GetComponent <MeshRenderer>().enabled = true;
            UserMeshRenderer.material = Resources.Load <UnityEngine.Material>("White");
            MeshIsWhite = true;
            break;

        case Pitch.D1:
            // final final cueF
            RainParticles.SetActive(true);
            // fade out tunnel video and make user render white
            VideoLayersController.Instance.FadeOutTunnel = true;
            UserMeshRenderer.material = Resources.Load <UnityEngine.Material>("White");
            // start user render fadeout
            TrackerSceneController.Instance.FadeOutStart = true;
            // Start Particle scene finale
            ParticleSceneController.Instance.FinaleState          = true;
            RainController.Instance.ActivateDefaultParticleColour = true;
            // and start fading them out
            ParticleSceneObject.SetActive(true);
            RainParticlesObject.SetActive(true);
            RainParticleController.StopParticleLength  = 200f;
            RainParticleController.StopParticleAmounts = new Vector2Int(4000, 4000);
            RainParticleController.SlowlyStopParticles = true;
            break;

        case Pitch.E1:
            RainParticleController.StopParticleLength = 1f;
            break;

        case Pitch.DSharp1:
            // evaporate
            break;

        case Pitch.CSharp6:
            // Crash toggles colour
            if (MeshIsWhite)
            {
                UserMeshRenderer.material = Resources.Load <UnityEngine.Material>("Black");
                MeshIsWhite = false;
            }
            else
            {
                UserMeshRenderer.material = Resources.Load <UnityEngine.Material>("White");
                MeshIsWhite = true;
            }
            break;
        }
    }
Example #6
0
 private static bool BeforeVideoSetup_Skip(VideoPlaybackController __instance)
 {
     return(!ShouldSkip(__instance.PlaybackSource));
 }