예제 #1
0
 protected override void Awake()
 {
     base.Awake();
     DoorAnimator    = GetComponent <Animator>();
     UnlockSwitch    = null;
     doorAudioSource = TransformCached.GetComponentInChildren <GvrAudioSource>();
 }
예제 #2
0
    protected override void Awake()
    {
        base.Awake();
        Cursor.lockState       = CursorLockMode.Locked;
        backgroundMusicSource  = GetComponent <AudioSource>();
        soundEffectAudioSource = TransformCached.FindBreadthFirst("SoundEffects").GetComponent <AudioSource>();
        Transform whiteScreenOverlay = TransformCached.FindBreadthFirst("WhiteScreenOverlay");

        if (whiteScreenOverlay != null)
        {
            whiteScreenOverlayObject = whiteScreenOverlay.gameObject;
            Renderer whiteScreenOverlayRenderer = whiteScreenOverlayObject.GetComponent <Renderer>();
            if (whiteScreenOverlayRenderer != null)
            {
                whiteScreenOverlayMaterial = whiteScreenOverlayRenderer.material;
                Color col = whiteScreenOverlayMaterial.color;
                whiteScreenOverlayMaterial.color = new Color(col.r, col.g, col.b, 0.0f);
            }
        }
        Transform blackScreenOverlay = TransformCached.FindBreadthFirst("BlackScreenOverlay");

        if (blackScreenOverlay != null)
        {
            blackScreenOverlayObject = blackScreenOverlay.gameObject;
            Renderer blackScreenOverlayRenderer = blackScreenOverlayObject.GetComponent <Renderer>();
            if (blackScreenOverlayRenderer != null)
            {
                blackScreenOverlayMaterial = blackScreenOverlayRenderer.material;
                Color col = blackScreenOverlayMaterial.color;
                blackScreenOverlayMaterial.color = new Color(col.r, col.g, col.b, 0.0f);
            }
        }
        Transform redScreenOverlay = TransformCached.FindBreadthFirst("RedScreenOverlay");

        if (redScreenOverlay != null)
        {
            redScreenOverlayObject = redScreenOverlay.gameObject;
            Renderer redScreenOverlayRenderer = redScreenOverlayObject.GetComponent <Renderer>();
            if (redScreenOverlayRenderer != null)
            {
                redScreenOverlayMaterial = redScreenOverlayRenderer.material;
                Color col = redScreenOverlayMaterial.color;
                redScreenOverlayMaterial.color = new Color(col.r, col.g, col.b, 0.0f);
            }
        }
        footStepsAudioSource = TransformCached.GetComponentInChildren <GvrAudioSource>();
        MainPlayer           = this;
    }