public void Initialize(eEffectType pType) { m_eType = pType; switch (m_eType) { case eEffectType.fire: FireInitialize(); break; case eEffectType.smoke: SmokeInitialize(); break; case eEffectType.explosion: ExplosionInitialize(); break; case eEffectType.snow: SnowInitialize(); break; case eEffectType.spiral: SpiralInitialize(); break; } }
/// <summary> 특정 이유(특정 상황에서 사운드가 안나와야 하거나 중복 사운드 방지 등)로 잠시 볼륨을 꺼놓을 때 사용 </summary> public void SetOffEffect(eEffectType type) { if (_effectTable[(int)type]) { _effectTable[(int)type].volume = 0; } }
public void UseEffect(eEffectType eEffect) { Timer t = vPool.GetFromPool((int)eEffect); t.transform.position = transform.position; t.transform.position += Vector3.up * 2; }
public virtual AbstractEffect GetOfType(eEffectType effectType) { ArrayList effects; Monitor.Enter(effects = this.m_effects); AbstractEffect result; try { foreach (AbstractEffect effect in this.m_effects) { if (effect.Type == effectType) { result = effect; return(result); } } } finally { Monitor.Exit(effects); } result = null; return(result); }
public void AddEffect(eEffectType type) { cEffect tempEffect = new cEffect(); tempEffect.Initialize(type); m_lAllEffects.Add(tempEffect); }
public void StopEffect(eEffectType soundType) { if (_effectTable[(int)soundType]) { _effectTable[(int)soundType].Stop(); } }
public static void Play(eEffectType type, Vector3 pos, int colorIndex) { // 強引に... GameObject obj; if (type == eEffectType.Bubble) { obj = poolBubble.GetInstance(); } else { obj = poolBurst.GetInstance(); } if (obj == null) { return; } ParticleSystem eff = obj.GetComponent <ParticleSystem>(); eff.transform.position = pos; eff.startColor = CustomColorTheme.GetColors()[colorIndex]; eff.Play(); }
/// <summary> /// Initializes a new instance of the <see cref="NiTextureEffect"/> class. /// </summary> /// <param name="file">The file.</param> /// <param name="reader">The reader.</param> /// <exception cref="Exception">NOT SUPPORTED!</exception> public NiTextureEffect(NiFile file, BinaryReader reader) : base(file, reader) { this.ModelProjectionMatrix = reader.ReadMatrix33(); this.ModelProjectionTransform = reader.ReadVector3(); this.TextureFiltering = (eTexFilterMode)reader.ReadUInt32(); this.TextureClamping = (eTexClampMode)reader.ReadUInt32(); this.EffectType = (eEffectType)reader.ReadUInt32(); this.CoordGenType = (eCoordGenType)reader.ReadUInt32(); if (base.Version <= eNifVersion.VER_3_1) { throw new Exception("NOT SUPPORTED!"); } if (base.Version >= eNifVersion.VER_4_0_0_0) { this.SourceTexture = new NiRef <NiSourceTexture>(reader); } this.ClippingPlane = reader.ReadBoolean(Version); this.unknownVector = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); this.Unknown2 = reader.ReadSingle(); if (this.File.Header.Version <= eNifVersion.VER_10_2_0_0) { this.PS2L = reader.ReadInt16(); this.PS2K = reader.ReadInt16(); } if (this.File.Header.Version <= eNifVersion.VER_4_1_0_12) { this.Unknown3 = reader.ReadUInt16(); } }
public float GetEffectLastPlayTime(eEffectType type) { if (mEffectLastPlayTime.ContainsKey(type)) { return(mEffectLastPlayTime[type]); } return(0f); }
public AbilityHitInfo(eEffectType et, GridCell target, eDisplacementType type) { location = target; dType = type; val = 0; element = eElement.NEUTRAL; effectType = et; }
public AbilityHitInfo(eEffectType et, int v, eElement e) { val = v; element = e; effectType = et; location = null; dType = eDisplacementType.BLINK; }
public GameObject GetEffect(eEffectType eType) { if (mDicEffectPool.ContainsKey(eType)) { return GameObject.Instantiate(mDicEffectPool[eType]); } return null; }
public float GetEffectLastTime(eEffectType type) { if (mEffectDuration != null && mEffectDuration.ContainsKey(type)) { return(mEffectDuration[type]); } return(1f); }
public void PlaySFX(eEffectType type, bool loop = false) { GameObject _sfxPlayer = Instantiate(sfxPlayer); //오디오소스를 프리팹으로 생성시켜 재생 _sfxPlayer.GetComponent <AudioSource>().loop = loop; _sfxPlayer.GetComponent <AudioSource>().clip = effectClips[(int)type]; _sfxPlayer.GetComponent <AudioSource>().volume = sfxVolume; _sfxPlayer.GetComponent <AudioSource>().Play(); sfxPlayers.Add(_sfxPlayer); //생성된 효과음은 리스트에 넣어서 일괄 관리 }
public Transform GetEfffectTrans(eEffectType type) { Transform existEffect = null; if (!mDelayRecycleEffcet.TryGetValue(type, out existEffect)) { Debug.LogError("不存在特效 effect = " + type); } return(existEffect); }
public virtual AbstractEffect GetOfType(eEffectType effectType) { lock (m_effects) { foreach (AbstractEffect effect in m_effects) { if (effect.Type == effectType) { return(effect); } } } return(null); }
public void PlayEffectSound(eEffectType type, float vol = 1.0f, bool isloop = false) { GameObject go = Instantiate(_soundmanager); go.transform.SetParent(transform); _effPlayer = go.GetComponent <AudioSource>(); _effPlayer.clip = _effClips[(int)type]; _effPlayer.volume = _EfVol; _effPlayer.loop = isloop; _effPlayer.Play(); _ltEffPlayer.Add(_effPlayer); }
public Transform IgnoreExitCreateEffect(eEffectType type, Transform parent = null, float recycleTime = 0f, Vector3 localOffset = default(Vector3), Quaternion localRotation = default(Quaternion)) { SpawnPool pool = EffectMgr.GetPool(); localOffset = localOffset == default(Vector3) ? Vector3.zero : localOffset; Vector3 creatPos = parent == null ? localOffset : parent.TransformPoint(localOffset); if (pool._perPrefabPoolOptions.Count < (int)type) { Debug.LogError("生成特效失败,type:" + type); return(null); } Transform trans = pool.Spawn(pool._perPrefabPoolOptions[(int)type].prefab, creatPos, Quaternion.identity); trans.parent = parent; if (parent != null) { SetLayer(trans.gameObject, parent.gameObject.layer); } trans.localRotation = localRotation == default(Quaternion) ? Quaternion.identity : localRotation; trans.localScale = Vector3.one; // ResetEffect(trans); if (recycleTime > 0f) { if (mEffectLastPlayTime != null) { if (mEffectLastPlayTime.ContainsKey(type)) { mEffectLastPlayTime[type] = Time.time; } else { mEffectLastPlayTime.Add(type, Time.time); } } StartCoroutine(DespawnEffect(type, trans, recycleTime)); } else { if (!mDelayRecycleEffcet.ContainsKey(type)) { mDelayRecycleEffcet.Add(type, trans); } } return(trans); }
public Transform CreateEffect(eEffectType type, Transform parent = null, float recycleTime = 0f, Vector3 localOffset = default(Vector3), Quaternion localRotation = default(Quaternion)) { Transform existEffect = null; if (recycleTime <= 0f && mDelayRecycleEffcet.TryGetValue(type, out existEffect)) { Debug.LogError("已经存在特效 effect = " + type); existEffect.localPosition = localOffset == default(Vector3) ? Vector3.zero : localOffset; existEffect.localRotation = localRotation == default(Quaternion) ? Quaternion.identity : localRotation; return(existEffect); } return(IgnoreExitCreateEffect(type, parent, recycleTime, localOffset, localRotation)); }
public GameObject GetFromPool(eEffectType input) { int index = (int)input; for (int i = 0; i < effectList[index].Count; i++) { if (!effectList[index][i].gameObject.activeInHierarchy) { return(effectList[index][i]); } } GameObject temp = Instantiate(effect[index]); effectList[index].Add(temp); return(temp); }
public void RecycleEffect(eEffectType type) { SpawnPool pool = EffectMgr.GetPool(); Transform existEffect = null; if (mDelayRecycleEffcet.TryGetValue(type, out existEffect)) { DespawnEffect(type, existEffect); mDelayRecycleEffcet.Remove(type); } else { Debug.LogError("不存在特效 effect = " + type); } }
public void DespawnEffect(eEffectType type, Transform trans) { if (trans == null) { return; } SpawnPool pool = EffectMgr.GetPool(); ResetEffect(trans); pool.Despawn(trans, pool._perPrefabPoolOptions [(int)type]); trans.parent = pool.transform; if (mEffectLastPlayTime.ContainsKey(type)) { mEffectLastPlayTime.Remove(type); } }
//查询是否有某个效果ID public bool IsHaveEffectId(BuffList _this, eEffectType effectid) { foreach (var i in _this.mData) { if (i.GetActive() == false) { continue; } var tbBuff = i.mBuff; for (var j = 0; j != tbBuff.effectid.Length; ++j) { if (tbBuff.effectid[j] == (int)effectid) { return(true); } } } return(false); }
//获得BUFF中某个效果ID的某个参数(二进制检查) public bool GetEffectParam_Bin(BuffList _this, eEffectType effectid, int paramid, int value) { foreach (var i in _this.mData) { if (i.GetActive() == false) { continue; } var tbBuff = i.mBuff; for (var j = 0; j != tbBuff.effectid.Length; ++j) { if (tbBuff.effectid[j] == (int)effectid) { if (BitFlag.GetLow(tbBuff.effectparam[j, paramid], value)) { return(true); } } } } return(false); }
public void PlayEffect(eEffectType soundType) { if (_effectVolume <= 0) { return; } if (_effectTable.Count > (int)soundType && _effectTable[(int)soundType].clip) { if (_effectTable[(int)soundType].isPlaying && _effectTable[(int)soundType].clip.length >= 1.0f) { GameObject audio = new GameObject("EffectAudio"); var source = audio.AddComponent <AudioSource>(); source.clip = Resources.Load(string.Format(EFFECT_PATH, _effectTable[(int)soundType].clip.name)) as AudioClip; source.volume = _effectVolume; source.loop = _effectTable[(int)soundType].loop; source.Play(); } else { _effectTable[(int)soundType].Play(); } } }
public CardEffect(string effectId, string effectString) { this.effectType = (eEffectType)Enum.Parse(typeof(eEffectType), effectId); this.effectString = effectString; }
public BasePlayerEffect(eEffectType type) : base(type) { }
public static string GetEffectName(eEffectType iID) { return(iID.ToString()); }
public AbstractEffect(eEffectType type) { rand = new Random(); m_type = type; }
public static string GetEffectNameShort(eEffectType iID) { return(iID != eEffectType.Endurance ? ((eEffectTypeShort)iID).ToString() : "End"); }
public void OnGUI() { EditorGUILayout.LabelField("标记索引", FlagIndex.ToString()); TargetType = (eTargetType)EditorGUILayout.EnumPopup("目标类型", TargetType); AutoDestroy = EditorGUILayout.Toggle("是否自动销毁", AutoDestroy); DummyPoint = (eAvatarType)EditorGUILayout.EnumPopup("骨骼点", DummyPoint); EditorGUILayout.BeginHorizontal(); EffectPrefab = EditorGUILayout.TextField("特效预设路径", EffectPrefab); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { EffectPrefab = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EffectType = (eEffectType)EditorGUILayout.EnumPopup("特效类型", EffectType); Scale = EditorGUILayout.FloatField("特效缩放", Scale); ScaleApplyModel = EditorGUILayout.Toggle("特效是否随模型缩放比", ScaleApplyModel); OffsetPos = EditorGUILayout.Vector3Field("特效位置偏移", OffsetPos); OffsetRotate = EditorGUILayout.Vector3Field("特效旋转偏移", OffsetRotate); DelayDestroyTime = EditorGUILayout.FloatField("延迟销毁", DelayDestroyTime); if (EffectType == eEffectType.Bullet || EffectType == eEffectType.Trace) { Speed = EditorGUILayout.FloatField("速度", Speed); } if (EffectType == eEffectType.Attach) { OnlyTranslate = EditorGUILayout.Toggle("attach特效是否只位置改变", OnlyTranslate); } RotateToAttacker = EditorGUILayout.Toggle("是否朝向释放者", RotateToAttacker); if (EffectType == eEffectType.Bullet) { LifeTime = EditorGUILayout.FloatField("子弹生命时间", LifeTime); } if (EffectType == eEffectType.Bullet || EffectType == eEffectType.Trace) { EditorGUILayout.BeginHorizontal(); ArrivedInstance = EditorGUILayout.TextField("击中目标实例预设", ArrivedInstance); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开击中目标实例预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { ArrivedInstance = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); } if (EffectType == eEffectType.Trace) { TraceType = (eTraceType)EditorGUILayout.EnumPopup("追踪特效类型", TraceType); TraceDummyPoint = (eAvatarType)EditorGUILayout.EnumPopup("追踪特效打击骨骼点", TraceDummyPoint); TraceOffsetLen = EditorGUILayout.FloatField("抛物线偏移距离", TraceOffsetLen); TraceOffsetAngle = EditorGUILayout.FloatField("抛物线偏移角度", TraceOffsetAngle); FactorVal = EditorGUILayout.FloatField("抛物线计算因子", FactorVal); TraceOffsetStandDis = EditorGUILayout.FloatField("抛物线参考距离", TraceOffsetStandDis); } if (EffectType == eEffectType.Bullet) { BulletACross = EditorGUILayout.Toggle("子弹是否穿越", BulletACross); BulletDamageWidth = EditorGUILayout.FloatField("子弹穿越伤害宽度", BulletDamageWidth); } if (EffectType == eEffectType.Boomerang) { // Target = GlobalData.TargetType.TargetType_None; Speed = EditorGUILayout.FloatField("速度", Speed); OnceTime = EditorGUILayout.FloatField("抵达折返点时间", OnceTime); BackToAttaker = EditorGUILayout.Toggle("返回到角色", BackToAttaker); BooDamageWidth = EditorGUILayout.FloatField("回旋镖穿越伤害宽度", BooDamageWidth); } if (EffectType == eEffectType.Bounce) { Speed = EditorGUILayout.FloatField("速度", Speed); BounceTimes = EditorGUILayout.IntField("最大弹跳次数", BounceTimes); BounceDistance = EditorGUILayout.FloatField("最大弹跳距离", BounceDistance); } if (EffectType == eEffectType.Thunder) { Speed = EditorGUILayout.FloatField("速度", Speed); TraceDummyPoint = (eAvatarType)EditorGUILayout.EnumPopup("链接目标骨骼点", TraceDummyPoint); EditorGUILayout.BeginHorizontal(); ThunderPrefab = EditorGUILayout.TextField("链条特效预设路径", ThunderPrefab); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { ThunderPrefab = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } if (EffectType == eEffectType.Laser) { LaserMaxLength = EditorGUILayout.FloatField("激光束最大长度", LaserMaxLength); LaserStartWidth = EditorGUILayout.FloatField("激光束开始宽度", LaserStartWidth); LaserEndWidth = EditorGUILayout.FloatField("激光束结束宽度", LaserEndWidth); LaserCalcDamageTime = EditorGUILayout.FloatField("激光束计算伤害时间间隔", LaserCalcDamageTime); EditorGUILayout.BeginHorizontal(); LaserHeadEffect = EditorGUILayout.TextField("激光头特效", LaserHeadEffect); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { LaserHeadEffect = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); LaserTailEffect = EditorGUILayout.TextField("激光尾特效", LaserTailEffect); if (GUILayout.Button(".", GUILayout.Width(20))) { string strPath = "Resources/"; string strVal = EditorUtility.OpenFilePanel("打开特效预设", Application.dataPath + "/Resources", "prefab"); int iPos = strVal.LastIndexOf(strPath); int toPos = strVal.LastIndexOf("."); if (iPos != -1 && toPos != -1) { LaserTailEffect = strVal.Substring(iPos + strPath.Length, toPos - iPos - strPath.Length); } } EditorGUILayout.EndHorizontal(); } EditorGUILayout.Space(); }
private IEnumerator DespawnEffect(eEffectType type, Transform trans, float waitTime) { yield return(new WaitForSeconds(waitTime)); DespawnEffect(type, trans); }
public virtual AbstractEffect GetOfType(eEffectType effectType) { lock (m_effects) { foreach (AbstractEffect effect in m_effects) if (effect.Type == effectType) return effect; } return null; }
/// <summary> /// Initializes a new instance of the <see cref="NiTextureEffect"/> class. /// </summary> /// <param name="file">The file.</param> /// <param name="reader">The reader.</param> /// <exception cref="Exception">NOT SUPPORTED!</exception> public NiTextureEffect(NiFile file, BinaryReader reader) : base(file, reader) { this.ModelProjectionMatrix = reader.ReadMatrix33(); this.ModelProjectionTransform = reader.ReadVector3(); this.TextureFiltering = (eTexFilterMode)reader.ReadUInt32(); this.TextureClamping = (eTexClampMode)reader.ReadUInt32(); this.EffectType = (eEffectType)reader.ReadUInt32(); this.CoordGenType = (eCoordGenType)reader.ReadUInt32(); if (base.Version <= eNifVersion.VER_3_1) { throw new Exception("NOT SUPPORTED!"); } if (base.Version >= eNifVersion.VER_4_0_0_0) { this.SourceTexture = new NiRef<NiSourceTexture>(reader); } this.ClippingPlane = reader.ReadBoolean(Version); this.unknownVector = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); this.Unknown2 = reader.ReadSingle(); if (this.File.Header.Version <= eNifVersion.VER_10_2_0_0) { this.PS2L = reader.ReadInt16(); this.PS2K = reader.ReadInt16(); } if (this.File.Header.Version <= eNifVersion.VER_4_1_0_12) { this.Unknown3 = reader.ReadUInt16(); } }
public void SetBuffParam(BuffParamKind _kind, Dictionary <BasePartsData, int> _value, float _time, int _skillId, UnitCtrl _source, bool _despelable, eEffectType _effectType, bool _isBuff, bool _additional) { if (_isBuff || !IsAbnormalState(eAbnormalState.NO_EFFECT_SLIP_DAMAGE)) { if (_effectType == eEffectType.COMMON) { //添加特效图标 } buffDebuffIndex++; StartCoroutine(UpdateBuffParam(_kind, _value, _time, _skillId, _source, _despelable, buffDebuffIndex, _isBuff, _additional)); } else { SetMissAtk(_source, eMissLogType.DODGE_BY_NO_DAMAGE_MOTION, eDamageEffectType.NORMAL, null, 1); } }