protected override void Awake() { base.Awake(); LightSwitchAnimator = GetComponent <Animator>(); Transform lBase = TransformCached.FindBreadthFirst("Base"); if (lBase != null) { LightSwitchBase = lBase.gameObject; Renderer LightSwitchBaseRenderer = LightSwitchBase.GetComponent <Renderer>(); if (LightSwitchBaseRenderer != null) { LightSwitchBaseMaterial = LightSwitchBaseRenderer.material; LightSwitchBaseColor = LightSwitchBaseMaterial.color; } } Transform lSwitch = TransformCached.FindBreadthFirst("Switch"); if (lSwitch != null) { LightSwitchSwitch = lSwitch.gameObject; Renderer LightSwitchSwitchRenderer = LightSwitchSwitch.GetComponent <Renderer>(); if (LightSwitchSwitchRenderer != null) { LightSwitchSwitchMaterial = LightSwitchSwitchRenderer.material; LightSwitchSwitchColor = LightSwitchSwitchMaterial.color; } } }
protected override void Awake() { base.Awake(); DoorAnimator = GetComponent <Animator>(); UnlockSwitch = null; doorAudioSource = TransformCached.GetComponentInChildren <GvrAudioSource>(); }
protected override void Awake() { base.Awake(); //Transform ceiling = TransformCached.Find ("CeilingTile"); //if (ceiling != null) { // CeilingTile = ceiling.gameObject; //} Transform floor = TransformCached.Find("FloorTile"); if (floor != null) { FloorTile = floor.gameObject; Renderer FloorTileRenderer = FloorTile.GetComponent <Renderer>(); if (FloorTileRenderer != null) { FloorTileMaterial = FloorTileRenderer.material; } } Transform light = TransformCached.Find("SpotLight"); if (light != null) { SpotLight = light.gameObject; } LightSource = '-'; }
protected override void Awake() { base.Awake(); EnemyAnimator = GetComponent <Animator>(); LightSource = '-'; IsLightActive = true; PatrolPath = new List <Vector3>(); headNode = TransformCached.FindBreadthFirst("HeadNode"); RestTimeSeconds = 0.0f; FieldOfView = 45.0f; }
protected override void Awake() { base.Awake(); DoorUnlockSwitchAnimator = GetComponent <Animator>(); Transform switchBase = TransformCached.FindBreadthFirst("Base"); if (switchBase != null) { DoorUnlockSwitchBase = switchBase.gameObject; Renderer DoorUnlockSwitchBaseRenderer = DoorUnlockSwitchBase.GetComponent <Renderer>(); if (DoorUnlockSwitchBaseRenderer != null) { DoorUnlockSwitchBaseMaterial = DoorUnlockSwitchBaseRenderer.material; DoorUnlockSwitchBaseColor = DoorUnlockSwitchBaseMaterial.color; } } Transform switchTopArm = TransformCached.FindBreadthFirst("TopArm"); if (switchTopArm != null) { DoorUnlockSwitchTopArm = switchTopArm.gameObject; Renderer DoorUnlockSwitchTopArmRenderer = DoorUnlockSwitchTopArm.GetComponent <Renderer>(); if (DoorUnlockSwitchTopArmRenderer != null) { DoorUnlockSwitchTopArmMaterial = DoorUnlockSwitchTopArmRenderer.material; DoorUnlockSwitchTopArmColor = DoorUnlockSwitchTopArmMaterial.color; } } Transform switchLeftArm = TransformCached.FindBreadthFirst("LeftArm"); if (switchLeftArm != null) { DoorUnlockSwitchLeftArm = switchLeftArm.gameObject; Renderer DoorUnlockSwitchLeftArmRenderer = DoorUnlockSwitchLeftArm.GetComponent <Renderer>(); if (DoorUnlockSwitchLeftArmRenderer != null) { DoorUnlockSwitchLeftArmMaterial = DoorUnlockSwitchLeftArmRenderer.material; DoorUnlockSwitchLeftArmColor = DoorUnlockSwitchLeftArmMaterial.color; } } Transform switchRightArm = TransformCached.FindBreadthFirst("RightArm"); if (switchRightArm != null) { DoorUnlockSwitchRightArm = switchRightArm.gameObject; Renderer DoorUnlockSwitchRightArmRenderer = DoorUnlockSwitchRightArm.GetComponent <Renderer>(); if (DoorUnlockSwitchRightArmRenderer != null) { DoorUnlockSwitchRightArmMaterial = DoorUnlockSwitchRightArmRenderer.material; DoorUnlockSwitchRightArmColor = DoorUnlockSwitchRightArmMaterial.color; } } }
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; }