public override void Play(ISkillAttacker attacker, SkillEffect se) { GameObject damage_obj = new GameObject("damage_obj"); MultHitNodeProp prop = m_NodeProp as MultHitNodeProp; if (prop == null) { return; } if (prop.attach) { damage_obj.transform.parent = attacker.GetRoot(); } else { damage_obj.transform.parent = helper.PlaceFxRoot; } EffectUtil.ResetLocalTransform(damage_obj.transform); damage_obj.transform.localPosition = prop.position; MultHitHandle handle = damage_obj.AddComponent <MultHitHandle>(); handle.m_attacker = attacker; //handle.m_damageRaduis = radius; handle.m_hitTimes = prop.hit_times; handle.m_deltaTime = prop.delta_time; // if (follow == false) // { // damage_obj.transform.parent = Util.PlaceFxRoot; // if (callback == null || by_target == false) // damage_obj.transform.localPosition = caster.transform.TransformPoint(position);//caster.transform.position + position; // else // damage_obj.transform.localPosition = callback.GetAttackTarget().transform.position; // } // else // { // damage_obj.transform.parent = caster.transform; // Util.ResetLocalTransform(damage_obj.transform); // damage_obj.transform.localPosition = position; // } //// Debug.LogWarning(caster); // PlaceDamageHandle handler = damage_obj.AddComponent<PlaceDamageHandle>(); // handler.m_Owner = caster; // handler.m_timeLen = time_len; // handler.m_deltaTime = delta_time; // handler.m_damageRaduis = radius; // handler.m_push = push; // handler.m_hitIndex = hit_index; // handler.m_hitNode = this; // handler.m_callback = callback; }
public static void AttachNode(Transform parent, Transform child) { child.parent = parent; EffectUtil.ResetLocalTransform(child); }