@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: a9ac0ea32767bfe42aa7ce6753104e25 | |||
timeCreated: 1485053650 | |||
licenseType: Free | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: 17ee00c36b59c344e83556e5bed577b6 | |||
timeCreated: 1485052411 | |||
licenseType: Free | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,76 @@ | |||
fileFormatVersion: 2 | |||
guid: 9a81218b321cc42eba4dd59f9b513146 | |||
timeCreated: 1485051858 | |||
licenseType: Pro | |||
TextureImporter: | |||
fileIDToRecycleName: {} | |||
serializedVersion: 4 | |||
mipmaps: | |||
mipMapMode: 0 | |||
enableMipMap: 0 | |||
sRGBTexture: 1 | |||
linearTexture: 0 | |||
fadeOut: 0 | |||
borderMipMap: 0 | |||
mipMapFadeDistanceStart: 1 | |||
mipMapFadeDistanceEnd: 3 | |||
bumpmap: | |||
convertToNormalMap: 0 | |||
externalNormalMap: 0 | |||
heightScale: 0.25 | |||
normalMapFilter: 0 | |||
isReadable: 0 | |||
grayScaleToAlpha: 0 | |||
generateCubemap: 6 | |||
cubemapConvolution: 0 | |||
seamlessCubemap: 0 | |||
textureFormat: 1 | |||
maxTextureSize: 2048 | |||
textureSettings: | |||
filterMode: -1 | |||
aniso: -1 | |||
mipBias: -1 | |||
wrapMode: 1 | |||
nPOTScale: 0 | |||
lightmap: 0 | |||
compressionQuality: 50 | |||
spriteMode: 1 | |||
spriteExtrude: 1 | |||
spriteMeshType: 1 | |||
alignment: 0 | |||
spritePivot: {x: 0.5, y: 0.5} | |||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} | |||
spritePixelsToUnits: 100 | |||
alphaUsage: 1 | |||
alphaIsTransparency: 1 | |||
spriteTessellationDetail: -1 | |||
textureType: 8 | |||
textureShape: 1 | |||
maxTextureSizeSet: 0 | |||
compressionQualitySet: 0 | |||
textureFormatSet: 0 | |||
platformSettings: | |||
- buildTarget: DefaultTexturePlatform | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
- buildTarget: Standalone | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
spriteSheet: | |||
serializedVersion: 2 | |||
sprites: [] | |||
outline: [] | |||
spritePackingTag: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,118 @@ | |||
fileFormatVersion: 2 | |||
guid: 11a03cf810b734d53aaf004e9813f384 | |||
timeCreated: 1485053643 | |||
licenseType: Pro | |||
TextureImporter: | |||
fileIDToRecycleName: | |||
21300000: shadows_0 | |||
21300002: shadows_1 | |||
21300004: shadows_2 | |||
serializedVersion: 4 | |||
mipmaps: | |||
mipMapMode: 0 | |||
enableMipMap: 0 | |||
sRGBTexture: 1 | |||
linearTexture: 0 | |||
fadeOut: 0 | |||
borderMipMap: 0 | |||
mipMapFadeDistanceStart: 1 | |||
mipMapFadeDistanceEnd: 3 | |||
bumpmap: | |||
convertToNormalMap: 0 | |||
externalNormalMap: 0 | |||
heightScale: 0.25 | |||
normalMapFilter: 0 | |||
isReadable: 0 | |||
grayScaleToAlpha: 0 | |||
generateCubemap: 6 | |||
cubemapConvolution: 0 | |||
seamlessCubemap: 0 | |||
textureFormat: 1 | |||
maxTextureSize: 2048 | |||
textureSettings: | |||
filterMode: -1 | |||
aniso: -1 | |||
mipBias: -1 | |||
wrapMode: 1 | |||
nPOTScale: 0 | |||
lightmap: 0 | |||
compressionQuality: 50 | |||
spriteMode: 2 | |||
spriteExtrude: 1 | |||
spriteMeshType: 1 | |||
alignment: 0 | |||
spritePivot: {x: 0.5, y: 0.5} | |||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} | |||
spritePixelsToUnits: 100 | |||
alphaUsage: 1 | |||
alphaIsTransparency: 1 | |||
spriteTessellationDetail: -1 | |||
textureType: 8 | |||
textureShape: 1 | |||
maxTextureSizeSet: 0 | |||
compressionQualitySet: 0 | |||
textureFormatSet: 0 | |||
platformSettings: | |||
- buildTarget: DefaultTexturePlatform | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
- buildTarget: Standalone | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
spriteSheet: | |||
serializedVersion: 2 | |||
sprites: | |||
- serializedVersion: 2 | |||
name: shadows_0 | |||
rect: | |||
serializedVersion: 2 | |||
x: 21 | |||
y: 243 | |||
width: 477 | |||
height: 260 | |||
alignment: 0 | |||
pivot: {x: 0, y: 0} | |||
border: {x: 0, y: 0, z: 0, w: 0} | |||
outline: [] | |||
tessellationDetail: 0 | |||
- serializedVersion: 2 | |||
name: shadows_1 | |||
rect: | |||
serializedVersion: 2 | |||
x: 241 | |||
y: 0 | |||
width: 262 | |||
height: 262 | |||
alignment: 0 | |||
pivot: {x: 0, y: 0} | |||
border: {x: 0, y: 0, z: 0, w: 0} | |||
outline: [] | |||
tessellationDetail: 0 | |||
- serializedVersion: 2 | |||
name: shadows_2 | |||
rect: | |||
serializedVersion: 2 | |||
x: 48 | |||
y: 15 | |||
width: 148 | |||
height: 226 | |||
alignment: 0 | |||
pivot: {x: 0, y: 0} | |||
border: {x: 0, y: 0, z: 0, w: 0} | |||
outline: [] | |||
tessellationDetail: 0 | |||
outline: [] | |||
spritePackingTag: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: eb66aff512dcb4d07a63d2a8ecd24bde | |||
timeCreated: 1485051885 | |||
licenseType: Pro | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -1,82 +0,0 @@ | |||
fileFormatVersion: 2 | |||
guid: 37549450629db464abffe54861590cf3 | |||
timeCreated: 1485008673 | |||
licenseType: Free | |||
ModelImporter: | |||
serializedVersion: 19 | |||
fileIDToRecycleName: | |||
100000: pCylinder3 | |||
100002: //RootNode | |||
400000: pCylinder3 | |||
400002: //RootNode | |||
2300000: pCylinder3 | |||
3300000: pCylinder3 | |||
4300000: pCylinder3 | |||
materials: | |||
importMaterials: 1 | |||
materialName: 0 | |||
materialSearch: 1 | |||
animations: | |||
legacyGenerateAnimations: 4 | |||
bakeSimulation: 0 | |||
resampleCurves: 1 | |||
optimizeGameObjects: 0 | |||
motionNodeName: | |||
animationImportErrors: | |||
animationImportWarnings: | |||
animationRetargetingWarnings: | |||
animationDoRetargetingWarnings: 0 | |||
animationCompression: 1 | |||
animationRotationError: 0.5 | |||
animationPositionError: 0.5 | |||
animationScaleError: 0.5 | |||
animationWrapMode: 0 | |||
extraExposedTransformPaths: [] | |||
clipAnimations: [] | |||
isReadable: 1 | |||
meshes: | |||
lODScreenPercentages: [] | |||
globalScale: 1 | |||
meshCompression: 0 | |||
addColliders: 0 | |||
importBlendShapes: 1 | |||
swapUVChannels: 0 | |||
generateSecondaryUV: 0 | |||
useFileUnits: 1 | |||
optimizeMeshForGPU: 1 | |||
keepQuads: 0 | |||
weldVertices: 1 | |||
secondaryUVAngleDistortion: 8 | |||
secondaryUVAreaDistortion: 15.000001 | |||
secondaryUVHardAngle: 88 | |||
secondaryUVPackMargin: 4 | |||
useFileScale: 1 | |||
tangentSpace: | |||
normalSmoothAngle: 60 | |||
normalImportMode: 0 | |||
tangentImportMode: 3 | |||
importAnimation: 1 | |||
copyAvatar: 0 | |||
humanDescription: | |||
serializedVersion: 2 | |||
human: [] | |||
skeleton: [] | |||
armTwist: 0.5 | |||
foreArmTwist: 0.5 | |||
upperLegTwist: 0.5 | |||
legTwist: 0.5 | |||
armStretch: 0.05 | |||
legStretch: 0.05 | |||
feetSpacing: 0 | |||
rootMotionBoneName: | |||
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} | |||
hasTranslationDoF: 0 | |||
hasExtraRoot: 0 | |||
skeletonHasParents: 1 | |||
lastHumanDescriptionAvatarSource: {instanceID: 0} | |||
animationType: 0 | |||
humanoidOversampling: 1 | |||
additionalBone: 0 | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,68 @@ | |||
fileFormatVersion: 2 | |||
guid: 8108a8c7021f51f40b59580b43dbfd2a | |||
timeCreated: 1485052499 | |||
licenseType: Free | |||
TextureImporter: | |||
fileIDToRecycleName: {} | |||
serializedVersion: 4 | |||
mipmaps: | |||
mipMapMode: 0 | |||
enableMipMap: 1 | |||
sRGBTexture: 1 | |||
linearTexture: 0 | |||
fadeOut: 0 | |||
borderMipMap: 0 | |||
mipMapFadeDistanceStart: 1 | |||
mipMapFadeDistanceEnd: 3 | |||
bumpmap: | |||
convertToNormalMap: 0 | |||
externalNormalMap: 0 | |||
heightScale: 0.25 | |||
normalMapFilter: 0 | |||
isReadable: 0 | |||
grayScaleToAlpha: 0 | |||
generateCubemap: 6 | |||
cubemapConvolution: 0 | |||
seamlessCubemap: 0 | |||
textureFormat: 1 | |||
maxTextureSize: 2048 | |||
textureSettings: | |||
filterMode: -1 | |||
aniso: -1 | |||
mipBias: -1 | |||
wrapMode: -1 | |||
nPOTScale: 1 | |||
lightmap: 0 | |||
compressionQuality: 50 | |||
spriteMode: 0 | |||
spriteExtrude: 1 | |||
spriteMeshType: 1 | |||
alignment: 0 | |||
spritePivot: {x: 0.5, y: 0.5} | |||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} | |||
spritePixelsToUnits: 100 | |||
alphaUsage: 1 | |||
alphaIsTransparency: 0 | |||
spriteTessellationDetail: -1 | |||
textureType: 0 | |||
textureShape: 1 | |||
maxTextureSizeSet: 0 | |||
compressionQualitySet: 0 | |||
textureFormatSet: 0 | |||
platformSettings: | |||
- buildTarget: DefaultTexturePlatform | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
spriteSheet: | |||
serializedVersion: 2 | |||
sprites: [] | |||
outline: [] | |||
spritePackingTag: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,68 @@ | |||
fileFormatVersion: 2 | |||
guid: 9b0ec7c3400bea04c94e9bd4d17a0ffc | |||
timeCreated: 1485052499 | |||
licenseType: Free | |||
TextureImporter: | |||
fileIDToRecycleName: {} | |||
serializedVersion: 4 | |||
mipmaps: | |||
mipMapMode: 0 | |||
enableMipMap: 1 | |||
sRGBTexture: 1 | |||
linearTexture: 0 | |||
fadeOut: 0 | |||
borderMipMap: 0 | |||
mipMapFadeDistanceStart: 1 | |||
mipMapFadeDistanceEnd: 3 | |||
bumpmap: | |||
convertToNormalMap: 0 | |||
externalNormalMap: 0 | |||
heightScale: 0.25 | |||
normalMapFilter: 0 | |||
isReadable: 0 | |||
grayScaleToAlpha: 0 | |||
generateCubemap: 6 | |||
cubemapConvolution: 0 | |||
seamlessCubemap: 0 | |||
textureFormat: 1 | |||
maxTextureSize: 2048 | |||
textureSettings: | |||
filterMode: -1 | |||
aniso: -1 | |||
mipBias: -1 | |||
wrapMode: -1 | |||
nPOTScale: 1 | |||
lightmap: 0 | |||
compressionQuality: 50 | |||
spriteMode: 0 | |||
spriteExtrude: 1 | |||
spriteMeshType: 1 | |||
alignment: 0 | |||
spritePivot: {x: 0.5, y: 0.5} | |||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} | |||
spritePixelsToUnits: 100 | |||
alphaUsage: 1 | |||
alphaIsTransparency: 0 | |||
spriteTessellationDetail: -1 | |||
textureType: 0 | |||
textureShape: 1 | |||
maxTextureSizeSet: 0 | |||
compressionQualitySet: 0 | |||
textureFormatSet: 0 | |||
platformSettings: | |||
- buildTarget: DefaultTexturePlatform | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
spriteSheet: | |||
serializedVersion: 2 | |||
sprites: [] | |||
outline: [] | |||
spritePackingTag: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,76 @@ | |||
fileFormatVersion: 2 | |||
guid: 42574f2ff1b9d00479fce7fa9823e0ad | |||
timeCreated: 1485052499 | |||
licenseType: Free | |||
TextureImporter: | |||
fileIDToRecycleName: {} | |||
serializedVersion: 4 | |||
mipmaps: | |||
mipMapMode: 0 | |||
enableMipMap: 1 | |||
sRGBTexture: 0 | |||
linearTexture: 0 | |||
fadeOut: 0 | |||
borderMipMap: 0 | |||
mipMapFadeDistanceStart: 1 | |||
mipMapFadeDistanceEnd: 3 | |||
bumpmap: | |||
convertToNormalMap: 0 | |||
externalNormalMap: 0 | |||
heightScale: 0.25 | |||
normalMapFilter: 0 | |||
isReadable: 0 | |||
grayScaleToAlpha: 0 | |||
generateCubemap: 6 | |||
cubemapConvolution: 0 | |||
seamlessCubemap: 0 | |||
textureFormat: 1 | |||
maxTextureSize: 2048 | |||
textureSettings: | |||
filterMode: -1 | |||
aniso: -1 | |||
mipBias: -1 | |||
wrapMode: -1 | |||
nPOTScale: 1 | |||
lightmap: 0 | |||
compressionQuality: 50 | |||
spriteMode: 0 | |||
spriteExtrude: 1 | |||
spriteMeshType: 1 | |||
alignment: 0 | |||
spritePivot: {x: 0.5, y: 0.5} | |||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} | |||
spritePixelsToUnits: 100 | |||
alphaUsage: 1 | |||
alphaIsTransparency: 0 | |||
spriteTessellationDetail: -1 | |||
textureType: 1 | |||
textureShape: 1 | |||
maxTextureSizeSet: 0 | |||
compressionQualitySet: 0 | |||
textureFormatSet: 0 | |||
platformSettings: | |||
- buildTarget: DefaultTexturePlatform | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
- buildTarget: Standalone | |||
maxTextureSize: 2048 | |||
textureFormat: -1 | |||
textureCompression: 1 | |||
compressionQuality: 50 | |||
crunchedCompression: 0 | |||
allowsAlphaSplitting: 0 | |||
overridden: 0 | |||
spriteSheet: | |||
serializedVersion: 2 | |||
sprites: [] | |||
outline: [] | |||
spritePackingTag: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: ca5d73253182e408ca7ed18a9f88c137 | |||
timeCreated: 1485000941 | |||
licenseType: Pro | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: 15855eec8f44a48169b15f54f2988b2e | |||
timeCreated: 1485052510 | |||
licenseType: Pro | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: ff24e35626d4349e7be883de5e03e5b1 | |||
timeCreated: 1485036737 | |||
licenseType: Pro | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: 93e56074113fd4131820ce9d0c7d6a77 | |||
timeCreated: 1485040026 | |||
licenseType: Pro | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: 4d7604cf4d94343189f9ca8fa401a92b | |||
timeCreated: 1485054847 | |||
licenseType: Pro | |||
NativeFormatImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,272 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
public class AudioController : MonoBehaviour | |||
{ | |||
public Transform objectA; | |||
public Transform objectB; | |||
public AudioSource[] bgmSources; | |||
public AudioSource[] ambSources; | |||
public AudioSource[] sfxSources; | |||
public AudioClip[] bgmClips; | |||
public AudioClip[] ambClips; | |||
public AudioClip[] sfxClips; | |||
void Awake() | |||
{ | |||
NotificationServer.register("play bgm", playBgm); | |||
NotificationServer.register("play amb", playAmb); | |||
NotificationServer.register("play sfx", playSfx); | |||
NotificationServer.register("fade bgm", fadeBgm); | |||
NotificationServer.register("fade amb", fadeAmb); | |||
NotificationServer.register("statechange Searchlight", searchlightStateChanged); | |||
} | |||
void Start() | |||
{ | |||
foreach (AudioSource s in bgmSources) | |||
s.volume = 0f; | |||
foreach (AudioSource s in ambSources) | |||
s.volume = 0f; | |||
foreach (AudioSource s in sfxSources) | |||
s.volume = 0f; | |||
NotificationServer.notify("play amb", "oceanAmbience:0.4"); | |||
} | |||
// void Update() | |||
// { | |||
// doMusicMix(); | |||
// } | |||
public void doMusicMix() | |||
{ | |||
NotificationServer.notify("play bgm", "tense:0.75"); | |||
// float distance = Vector3.Distance(objectA.position, objectB.position); | |||
// Debug.LogWarning(distance); | |||
// distance = Mathf.Clamp(1000f / distance, 0f, 1f); | |||
// float tenseVol = 0.75f * distance; | |||
// float spottedVol = 0.5f * (1f-distance); | |||
// NotificationServer.notify("play bgm", "tense:"+tenseVol+"/spotted"+spottedVol); | |||
} | |||
public void searchlightStateChanged() | |||
{ | |||
if (Searchlight.state == Searchlight.SearchState.Chasing) | |||
{ | |||
NotificationServer.notify("play sfx", "shipSpotted:0.5"); | |||
// NotificationServer.notify("play sfx", "spottedDialogue"); | |||
NotificationServer.notify("play bgm", "attack:9"); | |||
} | |||
else | |||
{ | |||
doMusicMix(); | |||
} | |||
} | |||
public void playAmb(object audioNameObj) | |||
{ | |||
string audioName = audioNameObj as string; | |||
if (audioName == null || audioName == "") | |||
return; | |||
string[] tokens = audioName.ToLower().Split(':'); | |||
audioName = tokens[0]; | |||
float volume = 1f; | |||
if (tokens.Length > 1) | |||
float.TryParse(tokens[1], out volume); | |||
AudioClip clip = null; | |||
foreach (AudioClip c in ambClips) | |||
{ | |||
if (c.name.ToLower() == audioName) | |||
{ | |||
clip = c; | |||
break; | |||
} | |||
} | |||
if (clip == null) | |||
return; | |||
bool foundEmpty = false; | |||
foreach (AudioSource s in ambSources) | |||
{ | |||
if (s.isPlaying) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
LeanTween.value(s.gameObject, s.volume, 0f, 1f).setOnUpdate((float val)=>{ | |||
s.volume = val; | |||
}).setOnComplete(()=>{ | |||
s.Stop(); | |||
s.clip = null; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
else if (!foundEmpty) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
foundEmpty = true; | |||
s.clip = clip; | |||
s.Play(); | |||
LeanTween.value(s.gameObject, s.volume, volume, 1f).setOnUpdate((float val)=>{ | |||
s.volume = val; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
} | |||
} | |||
public void playSfx(object audioNameObj) | |||
{ | |||
string audioName = audioNameObj as string; | |||
if (audioName == null || audioName == "") | |||
return; | |||
string[] tokens = audioName.ToLower().Split(':'); | |||
audioName = tokens[0]; | |||
float volume = 1f; | |||
if (tokens.Length > 1) | |||
float.TryParse(tokens[1], out volume); | |||
AudioClip clip = null; | |||
foreach (AudioClip c in sfxClips) | |||
{ | |||
if (c.name.ToLower() == audioName) | |||
{ | |||
clip = c; | |||
break; | |||
} | |||
} | |||
if (clip == null) | |||
return; | |||
foreach (AudioSource s in sfxSources) | |||
{ | |||
if (!s.isPlaying) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
s.clip = clip; | |||
s.volume = volume; | |||
s.Play(); | |||
} | |||
} | |||
} | |||
public void playBgm(object audioNameObj) | |||
{ | |||
string audioNames = audioNameObj as string; | |||
if (audioNames == null || audioNames == "") | |||
return; | |||
audioNames = audioNames.ToLower(); | |||
string[] tokens = audioNames.Split('/'); | |||
if (tokens.Length > 1) | |||
{ | |||
foreach (string t in tokens) | |||
playBgm(t.Trim()); | |||
return; | |||
} | |||
string[] tokens2 = audioNames.Split(':'); | |||
string audioName = tokens2[0]; | |||
float volume = 1f; | |||
if (tokens2.Length > 1) | |||
float.TryParse(tokens2[1], out volume); | |||
AudioClip clip = null; | |||
foreach (AudioClip c in bgmClips) | |||
{ | |||
if (c.name.ToLower() == audioName) | |||
{ | |||
clip = c; | |||
break; | |||
} | |||
} | |||
if (clip == null) | |||
return; | |||
AudioSource foundEmpty = null; | |||
int timeSamples = 0; | |||
foreach (AudioSource s in bgmSources) | |||
{ | |||
if (s.clip != null && s.clip == clip) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
foundEmpty = s; | |||
} | |||
else if (s.isPlaying) | |||
{ | |||
timeSamples = s.timeSamples; | |||
LeanTween.cancel(s.gameObject); | |||
LeanTween.value(s.gameObject, s.volume, 0f, 1f).setOnUpdate((float val)=>{ | |||
s.volume = val; | |||
}).setOnComplete(()=>{ | |||
s.Stop(); | |||
s.clip = null; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
else if (foundEmpty == null) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
foundEmpty = s; | |||
} | |||
} | |||
if (foundEmpty != null && !foundEmpty.isPlaying) | |||
{ | |||
LeanTween.cancel(foundEmpty.gameObject); | |||
foundEmpty.clip = clip; | |||
foundEmpty.timeSamples = timeSamples; | |||
foundEmpty.Play(); | |||
LeanTween.value(foundEmpty.gameObject, foundEmpty.volume, volume, 1f).setOnUpdate((float val)=>{ | |||
foundEmpty.volume = val; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
else if (foundEmpty != null && foundEmpty.isPlaying) | |||
{ | |||
LeanTween.cancel(foundEmpty.gameObject); | |||
LeanTween.value(foundEmpty.gameObject, foundEmpty.volume, volume, 1f).setOnUpdate((float val)=>{ | |||
foundEmpty.volume = val; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
} | |||
public void fadeBgm() | |||
{ | |||
foreach (AudioSource s in bgmSources) | |||
{ | |||
if (s.isPlaying) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
LeanTween.value(s.gameObject, s.volume, 0f, 1f).setOnUpdate((float val)=>{ | |||
s.volume = val; | |||
}).setOnComplete(()=>{ | |||
s.Stop(); | |||
s.clip = null; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
} | |||
} | |||
public void fadeAmb() | |||
{ | |||
foreach (AudioSource s in ambSources) | |||
{ | |||
if (s.isPlaying) | |||
{ | |||
LeanTween.cancel(s.gameObject); | |||
LeanTween.value(s.gameObject, s.volume, 0f, 1f).setOnUpdate((float val)=>{ | |||
s.volume = val; | |||
}).setOnComplete(()=>{ | |||
s.Stop(); | |||
s.clip = null; | |||
}).setIgnoreTimeScale(true); | |||
} | |||
} | |||
} | |||
} |
@ -0,0 +1,12 @@ | |||
fileFormatVersion: 2 | |||
guid: 66e9541bf46304a888e3e492fda8055d | |||
timeCreated: 1485043076 | |||
licenseType: Free | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,33 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
[RequireComponent(typeof(BoxCollider))] | |||
public class HidingSpot : MonoBehaviour { | |||
// Use this for initialization | |||
void Start() { | |||
GetComponent<BoxCollider>().isTrigger = true; | |||
} | |||
// Update is called once per frame | |||
void Update() { | |||
} | |||
void OnTriggerEnter(Collider other) { | |||
if (other.gameObject.CompareTag("Player")) { | |||
Searchlight.playerHidden = true; | |||
Debug.Log("player here"); | |||
} | |||
} | |||
void OnTriggerExit(Collider other) { | |||
if (other.gameObject.CompareTag("Player")) { | |||
Searchlight.playerHidden = false; | |||
Debug.Log("player exit"); | |||
} | |||
} | |||
} |
@ -0,0 +1,12 @@ | |||
fileFormatVersion: 2 | |||
guid: 0a8ee24f913b2504385604346da773d7 | |||
timeCreated: 1485054757 | |||
licenseType: Free | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,61 @@ | |||
using System.Collections; | |||
using System.Collections.Generic; | |||
using UnityEngine; | |||
public class LighthouseLanding : MonoBehaviour | |||
{ | |||
public bool switchedOff = false; | |||
private bool isTriggering = false; | |||
void Awake() | |||
{ | |||
NotificationServer.register("statechange Searchlight", searchlightStateChanged); | |||
} | |||
void OnTriggerEnter(Collider other) | |||
{ | |||
if (switchedOff) | |||
return; | |||
if (other.tag != "Player") | |||
return; | |||
if (Searchlight.state == Searchlight.SearchState.Chasing) | |||
return; | |||
if (isTriggering) | |||
return; | |||
isTriggering = true; | |||
NotificationServer.notify("show TakeoverButton"); | |||
} | |||
void OnTriggerExit(Collider other) | |||
{ | |||
if (switchedOff) | |||
return; | |||
if (other.tag != "Player") | |||
return; | |||
if (!isTriggering) | |||
return; | |||
isTriggering = false; | |||
NotificationServer.notify("hide TakeoverButton"); | |||
} | |||
void searchlightStateChanged() | |||
{ | |||
if (switchedOff) | |||
return; | |||
if (isTriggering && Searchlight.state == Searchlight.SearchState.Chasing) | |||
{ | |||
isTriggering = false; | |||
NotificationServer.notify("hide TakeoverButton"); | |||
} | |||
} | |||
public void switchOff() | |||
{ | |||
switchedOff = true; | |||
NotificationServer.notify("hide TakeoverButton"); | |||
NotificationServer.notify("play sfx", "assassination"); | |||
} | |||
} |
@ -0,0 +1,12 @@ | |||
fileFormatVersion: 2 | |||
guid: d48154a3b477045e68763f6fc4a168b7 | |||
timeCreated: 1485057688 | |||
licenseType: Free | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -1,8 +1,6 @@ | |||
fileFormatVersion: 2 | |||
guid: e3b0c439ea6f28c4fb3ce6bc58682b6b | |||
guid: 0fbabcae9313543ffbf1429aeac3664d | |||
folderAsset: yes | |||
timeCreated: 1485052873 | |||
licenseType: Pro | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
@ -1,7 +1,7 @@ | |||
fileFormatVersion: 2 | |||
guid: 599e1530282487c46b63fa0f00f5c846 | |||
timeCreated: 1485039717 | |||
licenseType: Pro | |||
guid: 4f48e22f51b6449849bfe949e93bd014 | |||
timeCreated: 1485054810 | |||
licenseType: Free | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: |
@ -1,14 +0,0 @@ | |||
fileFormatVersion: 2 | |||
<<<<<<< HEAD | |||
guid: 7562c5d08f15d254c92f6dbd50cd18c9 | |||
timeCreated: 1485039339 | |||
licenseType: Pro | |||
======= | |||
guid: 0fb49e3e0a97c2c4cb531c04d67f2615 | |||
timeCreated: 1485038927 | |||
licenseType: Free | |||
>>>>>>> 927ced4c4317bc1f86f167c9b1594cec30b8e540 | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -1,6 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: 73fb9ee280b0c75439600b4d5c3a6a7d | |||
guid: e3b0c439ea6f28c4fb3ce6bc58682b6b | |||
folderAsset: yes | |||
timeCreated: 1485052873 | |||
licenseType: Pro | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: |
@ -1,8 +1,15 @@ | |||
fileFormatVersion: 2 | |||
<<<<<<< HEAD | |||
guid: f58a00a3100922d4288203443c54d1a5 | |||
folderAsset: yes | |||
timeCreated: 1485052873 | |||
licenseType: Pro | |||
======= | |||
guid: be2c14b0c562c483bbe057367939b479 | |||
folderAsset: yes | |||
timeCreated: 1485052376 | |||
licenseType: Free | |||
>>>>>>> 497ca195525b3f1160bab1491e71a9a013e118fb | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
@ -1,5 +1,6 @@ | |||
fileFormatVersion: 2 | |||
guid: 7a2ebb0518fbb4d46a3aa17dac934dce | |||
guid: 1715d56e0d2b68246a82993db31014ab | |||
folderAsset: yes | |||
timeCreated: 1485038927 | |||
licenseType: Free | |||
DefaultImporter: |
@ -1,7 +1,7 @@ | |||
fileFormatVersion: 2 | |||
guid: 3c7e12539b1e2c048bbfe0734108abba | |||
timeCreated: 1485039339 | |||
licenseType: Pro | |||
guid: cfbf35b0592f24a209aa5903d6a661ed | |||
timeCreated: 1485054811 | |||
licenseType: Free | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: |
@ -1,8 +1,15 @@ | |||
fileFormatVersion: 2 | |||
<<<<<<< HEAD | |||
guid: d96f9b1229b84cb41b71f2332674b8e1 | |||
folderAsset: yes | |||
timeCreated: 1485052873 | |||
licenseType: Pro | |||
======= | |||
guid: bb5698073b8d847298f0287fcfbdd0de | |||
folderAsset: yes | |||
timeCreated: 1485052376 | |||
licenseType: Free | |||
>>>>>>> 497ca195525b3f1160bab1491e71a9a013e118fb | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
@ -0,0 +1,9 @@ | |||
fileFormatVersion: 2 | |||
guid: de5a3adcedb96f64183518ac89622ade | |||
folderAsset: yes | |||
timeCreated: 1485038927 | |||
licenseType: Free | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,8 @@ | |||
fileFormatVersion: 2 | |||
guid: e7fc7bcf373334aaba07b2047921a343 | |||
timeCreated: 1485054811 | |||
licenseType: Free | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,9 @@ | |||
fileFormatVersion: 2 | |||
guid: 2a6e699820a38a544acfc0015eb679a2 | |||
folderAsset: yes | |||
timeCreated: 1484972317 | |||
licenseType: Free | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |
@ -0,0 +1,9 @@ | |||
fileFormatVersion: 2 | |||
guid: 338533d5d159c00478a9fb5321b7d922 | |||
folderAsset: yes | |||
timeCreated: 1485007190 | |||
licenseType: Free | |||
DefaultImporter: | |||
userData: | |||
assetBundleName: | |||
assetBundleVariant: |