예제 #1
0
 // Update is called once per frame
 void Update()
 {
     if (!gc.SceneComplete())
     {
         if (flag)
         {
             StartCoroutine("StopTurning");
             src.Play();
             flag = false;
         }
         if (turning)
         {
             transform.Rotate(Vector3.right * Time.deltaTime * speed);
         }
     }
     else
     {
         if (!reset)
         {
             transform.rotation = originalRotation;
             StopCoroutine("StopTurning");
             reset = true;
         }
         src.Stop();
     }
 }
예제 #2
0
    IEnumerator PlayRoutine()
    {
        isPlaying = true;
        source.Play();
        float peakVol = source.volume;

        for (float time = 0f; time < openingDuration; time += Time.deltaTime)
        {
            float ratio = time / openingDuration;
            ratio         = openingCurve.Evaluate(ratio);
            source.volume = Mathf.Lerp(0, peakVol, ratio);
            yield return(null);
        }
        source.volume = peakVol;
        if (!source.loop || closeAfterClipLength)
        {
            yield return(new WaitForSeconds(clipLength - openingDuration - closingDuration));

            for (float time = 0f; time < closingDuration; time += Time.deltaTime)
            {
                float ratio = time / closingDuration;
                ratio         = closingCurve.Evaluate(ratio);
                source.volume = Mathf.Lerp(peakVol, 0f, ratio);
                yield return(null);
            }
            source.volume = 0f;
            isPlaying     = false;
            source.Stop();
        }
    }
예제 #3
0
	public void BeginReading () {
		src = GetComponent<CardboardAudioSource> ();
		gc = (GameController) FindObjectOfType(typeof(GameController));
		lc = (LightController) FindObjectOfType(typeof(LightController));
		src.Play ();
		lc.holy = true;
		StartCoroutine ("FinishReading");
	}
예제 #4
0
	// Use this for initialization
	void Start ()
    {
        CAS = GetComponent<CardboardAudioSource>();

        CAS.Stop();
        CAS.clip = AudioClips[Random.Range(0, AudioClips.Count)];
        CAS.Play();
	}
예제 #5
0
 public void BeginReading()
 {
     src = GetComponent <CardboardAudioSource> ();
     gc  = (GameController)FindObjectOfType(typeof(GameController));
     lc  = (LightController)FindObjectOfType(typeof(LightController));
     src.Play();
     lc.holy = true;
     StartCoroutine("FinishReading");
 }
예제 #6
0
 // Update is called once per frame
 void Update()
 {
     if (!audioSource.isPlaying)
     {
         if (gc.playerActive && !flags [1])
         {
             audioSource.clip = freeFall;
             audioSource.Play();
             flags [1] = true;
         }
         else if (gc.parachuteActive && !flags [2])
         {
             audioSource.clip = parachuteOpen;
             audioSource.Play();
             flags [2] = true;
         }
     }
 }
예제 #7
0
 // Use this for initialization
 void Start()
 {
     flags            = new bool[3];
     gc               = (GameController)FindObjectOfType(typeof(GameController));
     audioSource      = GetComponent <CardboardAudioSource> ();
     audioSource.clip = introduction;
     audioSource.Play();
     flags [0] = true;
 }
예제 #8
0
 // Use this for initialization
 void Start()
 {
     flags = new bool[3];
     gc =  (GameController) FindObjectOfType(typeof(GameController));
     audioSource = GetComponent<CardboardAudioSource> ();
     audioSource.clip = introduction;
     audioSource.Play ();
     flags [0] = true;
 }
예제 #9
0
    // Use this for initialization
    void Start ()
    {
        CAS = GetComponent<CardboardAudioSource>();

        Player = Camera.main.gameObject;
        
        CAS.Stop();
        CAS.clip = IntroClips[m_curClipIndex];
        CAS.Play();
	}
 public void SetPosition(Position position)
 {
     if (position != null)
     {
         transform.localPosition = position.AsGridLocalPosition(Marker.Target);
         audioSource.Play();
         animator.SetTrigger("LockOnTarget");
     }
     GetComponent <Animator> ().enabled = true;
 }
예제 #11
0
 // Update is called once per frame
 void Update()
 {
     if (playerActive)
     {
         if (!wind.isPlaying)
         {
             wind.Play();
         }
         wind.volume = playerVelocity > 100 ? 1 : playerVelocity / 100;
     }
 }
예제 #12
0
 // Update is called once per frame
 void Update()
 {
     if (gc.ActiveBell() && gc.GetInteractionKey() && gazedAt &&
         Vector3.Distance(transform.position, player.transform.position) < interactionDistance)
     {
         gc.bell = true;
         src.Play();
     }
     if (gc.SceneComplete())
     {
         src.Stop();
     }
 }
예제 #13
0
    void OnTriggerEnter(Collider col)
    {
        if ((DateTime.Now - lastStepTime).TotalSeconds < PLAY_INTERVAL_MIN_SEC)
        {
            // タップダンス的な足音連打事故を防ぐ
            return;
        }

        FootStepSounds.StepInfo info = footStepSounds.stepInfos.Find((i) => i.groundTag == col.gameObject.tag);
        if (info.HasValue())
        {
            aSource.clip = info.GetClipRandomely();
            aSource.Play();
            lastStepTime = DateTime.Now;
        }
    }