private void CreateSoundObject(NcSpriteFactory.NcSpriteNode ncSpriteNode) { if (!this.m_bShowEffect) { return; } if (ncSpriteNode.m_AudioClip != null) { if (this.m_CurrentSound == null) { this.m_CurrentSound = base.gameObject.AddComponent <NcAttachSound>(); } this.m_CurrentSound.m_AudioClip = ncSpriteNode.m_AudioClip; this.m_CurrentSound.m_bLoop = ncSpriteNode.m_bSoundLoop; this.m_CurrentSound.m_fVolume = ncSpriteNode.m_fSoundVolume; this.m_CurrentSound.m_fPitch = ncSpriteNode.m_fSoundPitch; this.m_CurrentSound.enabled = true; this.m_CurrentSound.Replay(); } }
void CreateSoundObject(NcSpriteNode ncSpriteNode) { // Debug.Log("CreateSoundObject"); if (m_bShowEffect == false) { return; } if (ncSpriteNode.m_AudioClip != null) { if (m_CurrentSound == null) { m_CurrentSound = gameObject.AddComponent <NcAttachSound>(); } m_CurrentSound.m_AudioClip = ncSpriteNode.m_AudioClip; m_CurrentSound.m_bLoop = ncSpriteNode.m_bSoundLoop; m_CurrentSound.m_fVolume = ncSpriteNode.m_fSoundVolume; m_CurrentSound.m_fPitch = ncSpriteNode.m_fSoundPitch; m_CurrentSound.Replay(); } }
public void ShowSelectAudioClipPopup(NcAttachSound selCom) { }
void CreateSoundObject(NcSpriteNode ncSpriteNode) { // Debug.Log("CreateSoundObject"); if (m_bShowEffect == false) return; if (ncSpriteNode.m_AudioClip != null) { if (m_CurrentSound == null) m_CurrentSound = gameObject.AddComponent<NcAttachSound>(); m_CurrentSound.m_AudioClip = ncSpriteNode.m_AudioClip; m_CurrentSound.m_bLoop = ncSpriteNode.m_bSoundLoop; m_CurrentSound.m_fVolume = ncSpriteNode.m_fSoundVolume; m_CurrentSound.m_fPitch = ncSpriteNode.m_fSoundPitch; m_CurrentSound.enabled = true; m_CurrentSound.Replay(); } }
// Property ------------------------------------------------------------------------- // Event Function ------------------------------------------------------------------- void OnEnable() { m_Sel = target as NcAttachSound; m_UndoManager = new FXMakerUndoManager(m_Sel, "NcAttachSound"); }
private static Texture[] PreloadTexture(GameObject tarObj, List <GameObject> parentPrefabList) { if (!NcEffectBehaviour.IsSafe()) { return(null); } Renderer[] componentsInChildren = tarObj.GetComponentsInChildren <Renderer>(true); List <Texture> list = new List <Texture>(); Renderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Renderer renderer = array[i]; if (renderer.get_sharedMaterials() != null && renderer.get_sharedMaterials().Length > 0) { Material[] sharedMaterials = renderer.get_sharedMaterials(); for (int j = 0; j < sharedMaterials.Length; j++) { Material material = sharedMaterials[j]; if (material != null && material.get_mainTexture() != null) { list.Add(material.get_mainTexture()); } } } } NcAttachPrefab[] componentsInChildren2 = tarObj.GetComponentsInChildren <NcAttachPrefab>(true); NcAttachPrefab[] array2 = componentsInChildren2; for (int k = 0; k < array2.Length; k++) { NcAttachPrefab ncAttachPrefab = array2[k]; if (ncAttachPrefab.m_AttachPrefab != null) { Texture[] array3 = NcEffectBehaviour.PreloadPrefab(ncAttachPrefab.m_AttachPrefab, parentPrefabList, true); if (array3 == null) { ncAttachPrefab.m_AttachPrefab = null; } else { list.AddRange(array3); } } } NcParticleSystem[] componentsInChildren3 = tarObj.GetComponentsInChildren <NcParticleSystem>(true); NcParticleSystem[] array4 = componentsInChildren3; for (int l = 0; l < array4.Length; l++) { NcParticleSystem ncParticleSystem = array4[l]; if (ncParticleSystem.m_AttachPrefab != null) { Texture[] array5 = NcEffectBehaviour.PreloadPrefab(ncParticleSystem.m_AttachPrefab, parentPrefabList, true); if (array5 == null) { ncParticleSystem.m_AttachPrefab = null; } else { list.AddRange(array5); } } } NcSpriteTexture[] componentsInChildren4 = tarObj.GetComponentsInChildren <NcSpriteTexture>(true); NcSpriteTexture[] array6 = componentsInChildren4; for (int m = 0; m < array6.Length; m++) { NcSpriteTexture ncSpriteTexture = array6[m]; if (ncSpriteTexture.m_NcSpriteFactoryPrefab != null) { Texture[] array7 = NcEffectBehaviour.PreloadPrefab(ncSpriteTexture.m_NcSpriteFactoryPrefab, parentPrefabList, false); if (array7 != null) { list.AddRange(array7); } } } NcAttachSound[] componentsInChildren5 = tarObj.GetComponentsInChildren <NcAttachSound>(true); NcAttachSound[] array8 = componentsInChildren5; for (int n = 0; n < array8.Length; n++) { NcAttachSound ncAttachSound = array8[n]; if (ncAttachSound.m_AudioClip != null) { } } NcSpriteFactory[] componentsInChildren6 = tarObj.GetComponentsInChildren <NcSpriteFactory>(true); NcSpriteFactory[] array9 = componentsInChildren6; for (int num = 0; num < array9.Length; num++) { NcSpriteFactory ncSpriteFactory = array9[num]; if (ncSpriteFactory.m_SpriteList != null) { for (int num2 = 0; num2 < ncSpriteFactory.m_SpriteList.get_Count(); num2++) { if (ncSpriteFactory.m_SpriteList.get_Item(num2).m_EffectPrefab != null) { Texture[] array10 = NcEffectBehaviour.PreloadPrefab(ncSpriteFactory.m_SpriteList.get_Item(num2).m_EffectPrefab, parentPrefabList, true); if (array10 == null) { ncSpriteFactory.m_SpriteList.get_Item(num2).m_EffectPrefab = null; } else { list.AddRange(array10); } if (ncSpriteFactory.m_SpriteList.get_Item(num2).m_AudioClip != null) { } } } } } return(list.ToArray()); }
protected static Texture[] PreloadResource(GameObject tarObj, List <GameObject> parentPrefabList) { if (!NcEffectBehaviour.IsSafe()) { return(null); } Renderer[] componentsInChildren = tarObj.GetComponentsInChildren <Renderer>(true); List <Texture> list = new List <Texture>(); Renderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Renderer renderer = array[i]; if (renderer.sharedMaterials != null && renderer.sharedMaterials.Length > 0) { Material[] sharedMaterials = renderer.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { Material material = sharedMaterials[j]; if (material != null && material.mainTexture != null) { list.Add(material.mainTexture); } } } } NcAttachPrefab[] componentsInChildren2 = tarObj.GetComponentsInChildren <NcAttachPrefab>(true); NcAttachPrefab[] array2 = componentsInChildren2; for (int k = 0; k < array2.Length; k++) { NcAttachPrefab ncAttachPrefab = array2[k]; if (ncAttachPrefab.m_AttachPrefab != null) { Texture[] array3 = NsEffectManager.PreloadPrefab(ncAttachPrefab.m_AttachPrefab, parentPrefabList, true); if (array3 == null) { ncAttachPrefab.m_AttachPrefab = null; } else { list.AddRange(array3); } } } NcParticleSystem[] componentsInChildren3 = tarObj.GetComponentsInChildren <NcParticleSystem>(true); NcParticleSystem[] array4 = componentsInChildren3; for (int l = 0; l < array4.Length; l++) { NcParticleSystem ncParticleSystem = array4[l]; if (ncParticleSystem.m_AttachPrefab != null) { Texture[] array5 = NsEffectManager.PreloadPrefab(ncParticleSystem.m_AttachPrefab, parentPrefabList, true); if (array5 == null) { ncParticleSystem.m_AttachPrefab = null; } else { list.AddRange(array5); } } } NcSpriteTexture[] componentsInChildren4 = tarObj.GetComponentsInChildren <NcSpriteTexture>(true); NcSpriteTexture[] array6 = componentsInChildren4; for (int m = 0; m < array6.Length; m++) { NcSpriteTexture ncSpriteTexture = array6[m]; if (ncSpriteTexture.m_NcSpriteFactoryPrefab != null) { Texture[] array7 = NsEffectManager.PreloadPrefab(ncSpriteTexture.m_NcSpriteFactoryPrefab, parentPrefabList, false); if (array7 != null) { list.AddRange(array7); } } } NcParticleSpiral[] componentsInChildren5 = tarObj.GetComponentsInChildren <NcParticleSpiral>(true); NcParticleSpiral[] array8 = componentsInChildren5; for (int n = 0; n < array8.Length; n++) { NcParticleSpiral ncParticleSpiral = array8[n]; if (ncParticleSpiral.m_ParticlePrefab != null) { Texture[] array9 = NsEffectManager.PreloadPrefab(ncParticleSpiral.m_ParticlePrefab, parentPrefabList, false); if (array9 != null) { list.AddRange(array9); } } } NcParticleEmit[] componentsInChildren6 = tarObj.GetComponentsInChildren <NcParticleEmit>(true); NcParticleEmit[] array10 = componentsInChildren6; for (int num = 0; num < array10.Length; num++) { NcParticleEmit ncParticleEmit = array10[num]; if (ncParticleEmit.m_ParticlePrefab != null) { Texture[] array11 = NsEffectManager.PreloadPrefab(ncParticleEmit.m_ParticlePrefab, parentPrefabList, false); if (array11 != null) { list.AddRange(array11); } } } NcAttachSound[] componentsInChildren7 = tarObj.GetComponentsInChildren <NcAttachSound>(true); NcAttachSound[] array12 = componentsInChildren7; for (int num2 = 0; num2 < array12.Length; num2++) { NcAttachSound ncAttachSound = array12[num2]; if (ncAttachSound.m_AudioClip != null) { } } NcSpriteFactory[] componentsInChildren8 = tarObj.GetComponentsInChildren <NcSpriteFactory>(true); NcSpriteFactory[] array13 = componentsInChildren8; for (int num3 = 0; num3 < array13.Length; num3++) { NcSpriteFactory ncSpriteFactory = array13[num3]; if (ncSpriteFactory.m_SpriteList != null) { for (int num4 = 0; num4 < ncSpriteFactory.m_SpriteList.Count; num4++) { if (ncSpriteFactory.m_SpriteList[num4].m_EffectPrefab != null) { Texture[] array14 = NsEffectManager.PreloadPrefab(ncSpriteFactory.m_SpriteList[num4].m_EffectPrefab, parentPrefabList, true); if (array14 == null) { ncSpriteFactory.m_SpriteList[num4].m_EffectPrefab = null; } else { list.AddRange(array14); } if (ncSpriteFactory.m_SpriteList[num4].m_AudioClip != null) { } } } } } return(list.ToArray()); }