public NkEffectUnit(EFFECT_INFO effectInfo, NkBattleChar OrderChar, bool bAttachEffectPos, bool CheckScale) { GameObject gameObject = null; Nr3DCharBase nr3DCharBase = OrderChar.Get3DChar(); if (nr3DCharBase != null) { gameObject = nr3DCharBase.GetRootGameObject(); } Vector3 v3Target = Vector3.zero; Transform effectPos = nr3DCharBase.GetEffectPos(effectInfo.EFFECT_POS); if (null != effectPos) { v3Target = effectPos.position; } if (effectInfo.EFFECT_POS == eEFFECT_POS.BONE && nr3DCharBase != null) { gameObject = nr3DCharBase.GetBoneRootObject(); if (gameObject == null) { gameObject = nr3DCharBase.GetRootGameObject(); } v3Target = Vector3.zero; v3Target.y = -1f; } this.m_CasterChar = OrderChar; if (bAttachEffectPos && effectPos != null) { gameObject = effectPos.gameObject; v3Target = Vector3.zero; } this.m_CheckScale = CheckScale; this.InitBase(eEFFECT_TARGET.GAMEOBJECT, effectInfo, gameObject, v3Target); }
public NkEffectUnit(EFFECT_INFO effectInfo, NkBattleChar OrderChar) { GameObject gameObject = null; Transform transform = null; Nr3DCharBase nr3DCharBase = OrderChar.Get3DChar(); if (nr3DCharBase != null) { gameObject = nr3DCharBase.GetRootGameObject(); transform = nr3DCharBase.GetEffectPos(effectInfo.EFFECT_POS); } Vector3 v3Target = Vector3.zero; if (null != transform) { v3Target = transform.position; } if (effectInfo.EFFECT_POS == eEFFECT_POS.BONE && nr3DCharBase != null) { gameObject = nr3DCharBase.GetBoneRootObject(); if (gameObject == null) { gameObject = nr3DCharBase.GetRootGameObject(); } v3Target = Vector3.zero; v3Target.y = -1f; } this.m_CasterChar = OrderChar; this.InitBase(eEFFECT_TARGET.POSITION, effectInfo, gameObject, v3Target); }
public uint AddEffect(string effectKind, NrCharBase kCharBase) { if (kCharBase == null) { return(0u); } Nr3DCharBase nr3DCharBase = kCharBase.Get3DChar(); if (nr3DCharBase == null) { return(0u); } EFFECT_INFO effectInfo = NrTSingleton <NkEffectManager> .Instance.GetEffectInfo(effectKind); if (effectInfo == null) { return(0u); } GameObject gameObject = nr3DCharBase.GetRootGameObject(); Vector3 v3Target = Vector3.zero; Transform effectPos = nr3DCharBase.GetEffectPos(effectInfo.EFFECT_POS); if (null != effectPos) { v3Target = effectPos.position; if (effectInfo.EFFECT_POS == eEFFECT_POS.CENTERDM) { gameObject = effectPos.gameObject; } } if (effectInfo.EFFECT_POS == eEFFECT_POS.BONE) { gameObject = nr3DCharBase.GetBoneRootObject(); if (gameObject == null) { gameObject = nr3DCharBase.GetRootGameObject(); } v3Target = Vector3.zero; v3Target.y = -1f; } NkEffectUnit kEffectUnit; if (effectInfo.EFFECT_POS == eEFFECT_POS.CENTERDM) { kEffectUnit = new NkEffectUnit(effectInfo, gameObject); } else { kEffectUnit = new NkEffectUnit(effectInfo, gameObject, v3Target); } return(this._AddEffect(kEffectUnit)); }