コード例 #1
0
        void Awake()
        {
            // mass in kg
            accelerationGravity = 9.81f;
            tracksMinHeight     = 3.66f;
            eKinStart           = massCart * 5;

            playerControllerGO = GameObject.FindWithTag("OVRPlayerController");
            playerController   = playerControllerGO.GetComponent <PlayerController>();
            ovrCameraRig       = playerControllerGO.transform.Find("OVRCameraRig").gameObject;

            audioSourceInstantiate             = gameObject.AddComponent <AudioSource>();
            audioSourceInstantiate.playOnAwake = false;
            audioSourceInstantiate.volume      = 0.5f;
            audioSourceInstantiate.clip        = audioClipInstantiate;

            audioSourceCountdown             = gameObject.AddComponent <AudioSource>();
            audioSourceCountdown.playOnAwake = false;
            audioSourceCountdown.volume      = 0.5f;
            audioSourceCountdown.clip        = audioClipCountDown;

            rb = GetComponent <Rigidbody>();
            fallBoxCollider.enabled = false;

            rollerCoasterBuilderController = GameObject.Find("RollerCoasterBuilder").GetComponent <RollerCoasterBuilderController>();

            isRunning = false;
            isMoving  = false;
        }
コード例 #2
0
ファイル: RCFinishLine.cs プロジェクト: shafy/kosmos-school
 void Start()
 {
     rollerCoasterBuilderController = GameObject.Find("RollerCoasterBuilder").GetComponent <RollerCoasterBuilderController>();
 }