Skip to content

Commit

Permalink
Add sound effect for nanome ad
Browse files Browse the repository at this point in the history
  • Loading branch information
ethandbrand committed Aug 29, 2018
1 parent ee2b9d8 commit 8362a4d
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 9 deletions.
Binary file added Assets/Resources/Audio/AudioFX/WaterDrop.wav
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Resources/Audio/AudioFX/WaterDrop.wav.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 82 additions & 1 deletion Assets/_Scenes/1 - IntroScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ GameObject:
- component: {fileID: 16928176}
- component: {fileID: 16928180}
- component: {fileID: 16928181}
- component: {fileID: 16928182}
m_Layer: 0
m_Name: ComingSoon
m_TagString: Untagged
Expand Down Expand Up @@ -278,7 +279,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7852cfae7c151834c8a571251f0fcd4e, type: 3}
m_Name:
m_EditorClassIdentifier:
HighlightColor: {r: 0.83137256, g: 0.93333334, b: 0.93333334, a: 1}
HighlightColor: {r: 0.78431374, g: 0.85490197, b: 0.9647059, a: 1}
--- !u!114 &16928177
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -342,6 +343,86 @@ MonoBehaviour:
disabledColor: {r: 0, g: 0, b: 0, a: 0}
verbose: 0
press: 0
--- !u!82 &16928182
AudioSource:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 16928173}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 5985163f5f412d74f9b3cd677163b370, type: 3}
m_PlayOnAwake: 0
m_Volume: 0.4
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!1 &18189778
GameObject:
m_ObjectHideFlags: 0
Expand Down
17 changes: 9 additions & 8 deletions Assets/_Scripts/Menus/Buttons/WebRedirect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,26 @@ private void Update()
}
protected override void ButtonEnterBehavior(GameObject other)
{
Application.OpenURL("http://nanome.ai/nanome");
StopAllCoroutines();
StartCoroutine(Darken(feedback, .5f, .3f, 1f));
transform.GetComponent<AudioSource>().Play();
Application.OpenURL("http://nanome.ai/nanome");
StopAllCoroutines();
StartCoroutine(FadeInOut(feedback, .5f, .3f, 1f));
}

protected override void ButtonExitBehavior(GameObject other)
{

}

IEnumerator Darken(Transform obj, float animTime, float animFade, float waitDuration){
IEnumerator FadeInOut(Transform obj, float fadeInTime, float fadeOutTime, float waitDuration){
float startTime = Time.time;
while (Time.time < startTime + animTime)
while (Time.time < startTime + fadeInTime)
{
if (obj == null)
{
yield break;
}
float a = Mathf.Lerp(0f, 1f, (Time.time - startTime) / animTime);
float a = Mathf.Lerp(0f, 1f, (Time.time - startTime) / fadeInTime);
obj.GetComponent<SpriteRenderer>().color = new Color(1f,1f,1f,a);
yield return null;
}
Expand All @@ -41,13 +42,13 @@ IEnumerator Darken(Transform obj, float animTime, float animFade, float waitDura
yield return null;
}
startTime = Time.time;
while (Time.time < startTime + animFade)
while (Time.time < startTime + fadeOutTime)
{
if (obj == null)
{
yield break;
}
float a = Mathf.Lerp(1f, 0f, (Time.time - startTime) / animFade);
float a = Mathf.Lerp(1f, 0f, (Time.time - startTime) / fadeOutTime);
obj.GetComponent<SpriteRenderer>().color = new Color(1f,1f,1f,a);
yield return null;
}
Expand Down

0 comments on commit 8362a4d

Please sign in to comment.