protected BattleEffectHandler PlayEffect(int effectResId, Vector3 postion, float speedRate = 1) { BattleEffectHandler effect = LoadEffect(effectResId); if (effect != null) { effect.transform.SetParent(transform); effect.transform.position = postion; effect.transform.localRotation = Quaternion.identity; effect.Play(speedRate); } return(effect); }
protected BattleEffectHandler PlayEffect(int effectResId, string bindpoint, float speedRate = 1) { BattleEffectHandler effect = LoadEffect(effectResId); if (effect != null) { effect.transform.parent = GetBindPoint(bindpoint); effect.transform.localPosition = Vector3.zero; effect.transform.localRotation = Quaternion.identity; effect.Play(speedRate); } return(effect); }
public void PlayAttributeEffect(long id, int effectResId, string bindpoint) { if (!attributeEffectHandlers.ContainsKey(id)) { BattleEffectHandler effect = PlayEffect(effectResId, bindpoint); if (effect != null) { attributeEffectHandlers.Add(id, effect); } } else { attributeEffectHandlers[id].Play(); } }