예제 #1
0
    void Start()
    {
        Debug.Log("Navigator started!");
        stepGameTimer    = 0f;
        PlayerCamera     = GameObject.FindGameObjectWithTag("casa").GetComponent <OVRCameraRig>();
        PlayerController = GameObject.FindGameObjectWithTag("PlayerController").GetComponent <OVRPlayerController>();
        // RedLight = GameObject.FindGameObjectWithTag("RedLight").GetComponent<Light>();
        lineRenderer = GetComponent <LineRenderer>();
        Heartbeat    = PlayerController.GetComponents <AudioSource>()[0];
        Breath       = PlayerController.GetComponents <AudioSource>()[1];
        EvilEye      = GameObject.FindGameObjectWithTag("Eye");
        EyeLight     = GameObject.FindGameObjectWithTag("EyeLight").GetComponent <Light>();
        LightUpEye   = GameObject.FindGameObjectWithTag("LightUpEye").GetComponent <Light>();

        // Getting audio sources
        BenignTutorial       = GetComponents <AudioSource>()[9];
        BenignWakeUpVictory  = GetComponents <AudioSource>()[8];
        BenignOneLastStep    = GetComponents <AudioSource>()[7];
        BenignSmashLight     = GetComponents <AudioSource>()[6];
        BadSpiritYouDead     = GetComponents <AudioSource>()[5];
        BenignStandUpAudio   = GetComponents <AudioSource>()[4];
        BenignStayDownAudio  = GetComponents <AudioSource>()[3];
        BenignGoingDownAudio = GetComponents <AudioSource>()[2];
        BenignStayStillAudio = GetComponents <AudioSource>()[1];
        SmashLightSound      = GetComponents <AudioSource>()[0];

        // Set initial variables
        initialHeartbeatPitch = Heartbeat.pitch;
        // initialLightIntensity = RedLight.intensity;
        // initialPlayerPosition = PlayerCamera.centerEyeAnchor.position;
        initialPlayerPosition      = StaticValue.initialPlayerPosition;
        initialPlayerLocalPosition = PlayerCamera.centerEyeAnchor.localPosition;
        boundary = OVRManager.boundary;
        guardianBoundariesPoint = new List <GameObject>();
        playAreaBoundariesPoint = new List <GameObject>();
        random = new System.Random();

        // getGuardianCenter();

        // BenignTutorial.Play(0);
    }