public void Start() { player = GameObject.FindGameObjectWithTag("Player").transform; _mover = player.GetComponent <Mover>(); _mover.Init(); _detector = player.GetComponent <Detector>(); _detector.Init(this); _recorder = player.GetComponent <RecorderAlt>(); _recorder.Init(); _successSound = GetComponent <AudioSource>(); startDoors = GameObject.FindGameObjectsWithTag("StartDoor"); startPicker = InitPickArray(startDoors.Length); endDoors = GameObject.FindGameObjectsWithTag("EndDoor"); endPicker = InitPickArray(endDoors.Length); foreach (GameObject door in endDoors) { door.GetComponent <EndDoorTrigger>().Init(this); } startDoor = startDoors[PickNew(ref startPicker)].transform; endDoor = endDoors[PickNew(ref endPicker)].transform; //SetupNewEndDoor(); vignetteSettings = ppProfile.vignette.settings; SetViewOpacity(1); StartCoroutine(Fade(FadeType.IN)); //Advance(); }
void OnEnable() { _recorder = GetComponent <RecorderAlt>(); _recorder.Init(); if (recordNewData) { _recorder.StartRecording(); return; } Texture2D posTex = DataToTexture.LoadPNG(Application.streamingAssetsPath + posFilePath); Texture2D rotTex = DataToTexture.LoadPNG(Application.streamingAssetsPath + rotFilePath); _recorder.SpawnRecordingWithSavedData(DataToTexture.ReadArrayFromTextures(posTex, rotTex)); }