/// SE再生(要事前登録) public bool PlaySE(SEList key, int channel = -1) { if (tableSE.ContainsKey((int)key) == false) { // 対応するキーがない場合は再生不可 Debug.Log("PlaySE key:" + key + " has not loaded..."); return(false); } // リソースの取得 SEData se = tableSE[(int)key]; if (0 <= channel && channel < SE_CHANNEL) { // チャンネル指定 var source = GetAudioSource(AudioType.SE, channel); source.clip = se.Clip; source.Play(); } else { // チャンネル指定なし var source = GetAudioSource(AudioType.SE); source.PlayOneShot(se.Clip); // 重複ありで再生 } return(true); }
public void PlaySE(string Key) { // Audio.PlayClipAtPoint(clip, 場所, 音量)を真似て作成 SEData data = m_param.SEs.GetByKey(Key); if (data == null) { Debug.LogAssertion(Key + " is NotFound"); return; } GameObject voice = new GameObject("VoiceObject"); voice.transform.position = Camera.main.transform.position + new Vector3(0.0f, 0.0f, 5.0f); AudioSource seSource = voice.AddComponent <AudioSource>(); seSource.clip = data.m_clip; seSource.volume = (float)data.m_volume / 100.0f; seSource.loop = false; seSource.playOnAwake = false; seSource.spatialBlend = 0; seSource.mute = false; seSource.outputAudioMixerGroup = m_param.SEMixer; seSource.Play(); voice.transform.parent = transform; Destroy(voice, data.m_clip.length); }
public void SetSESource() { SEList = Resources.Load <MycomSETable>("Scriotable/MycomSETable"); for (int i = 0; i < SEList.SEDataList.Count; i++) { SEData SEData = SEList.SEDataList[i]; if (SEData.Name == this.name) { this.GetComponent <AudioSource>().clip = SEData.SESource; } } }
private void CreateValSE(string name, SEData data) { var se = ScriptableObject.CreateInstance <SE_Stats>(); se.name = name; if (ResourceAssetManager.OdinMeadsName.Contains(name)) { se.m_icon = ResourceAssetManager.OdinMeadsIcons[name]; } se.m_name = "$op_" + name + "_name"; se.m_tooltip = "$op_" + name + "_tooltip"; se.m_ttl = data.m_ttl; se.m_tickInterval = data.m_tickInterval; se.m_healthPerTickMinHealthPercentage = data.m_healthPerTickMinHealthPercentage; se.m_healthPerTick = data.m_healthPerTick; se.m_healthOverTime = data.m_healthOverTime; se.m_healthOverTimeDuration = data.m_healthOverTimeDuration; se.m_healthOverTimeInterval = data.m_healthOverTimeInterval; se.m_staminaOverTimeDuration = data.m_staminaOverTimeDuration; se.m_staminaDrainPerSec = data.m_staminaDrainPerSec; se.m_runStaminaDrainModifier = data.m_runStaminaDrainModifier; se.m_jumpStaminaUseModifier = data.m_jumpStaminaUseModifier; se.m_healthRegenMultiplier = data.m_healthRegenMultiplier; se.m_staminaRegenMultiplier = data.m_staminaRegenMultiplier; se.m_raiseSkill = data.m_raiseSkill; se.m_raiseSkillModifier = data.m_raiseSkillModifier; //se.m_mods = new List<HitData.DamageModPair>() = data.m_mods = new List<HitData.DamageModPair>(); se.m_modifyAttackSkill = data.m_modifyAttackSkill; se.m_damageModifier = data.m_damageModifier; se.m_noiseModifier = data.m_noiseModifier; se.m_stealthModifier = data.m_stealthModifier; se.m_addMaxCarryWeight = data.m_addMaxCarryWeight; SElist.Add(name, se); }