コード例 #1
0
ファイル: Sfx.cs プロジェクト: AndreiMarks/ghost-bird
 public Sfx ApplyEffect( Sfx sfx )
 {
     sfx.GetComponent<AudioSource>().pitch = -sfx.GetComponent<AudioSource>().pitch;
     if(sfx.GetComponent<AudioSource>().pitch < 0)
         sfx.GetComponent<AudioSource>().time = sfx.GetComponent<AudioSource>().clip.length;
     return sfx;
 }
コード例 #2
0
ファイル: Sfx.cs プロジェクト: AndreiMarks/ghost-bird
 public Sfx ApplyEffect( Sfx sfx )
 {
     sfx.GetComponent<AudioSource>().pitch = Mathf.Lerp(min, max, scalar);
     return sfx;
 }
コード例 #3
0
ファイル: Sfx.cs プロジェクト: AndreiMarks/ghost-bird
 public Sfx ApplyEffect( Sfx sfx )
 {
     sfx.GetComponent<AudioSource>().pitch = Random.Range(min, max);
     return sfx;
 }