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)); }
public uint AddCenterPosEffect(string effectKind, NkBattleChar kBattleChar, Vector3 v3CenterPos) { if (this.m_bDontMakeEffect && NrTSingleton <NkEffectManager> .Instance.isEffectLimit(effectKind)) { return(0u); } if (kBattleChar == null) { return(0u); } Nr3DCharBase nr3DCharBase = kBattleChar.Get3DChar(); if (nr3DCharBase == null) { return(0u); } EFFECT_INFO effectInfo = NrTSingleton <NkEffectManager> .Instance.GetEffectInfo(effectKind); if (effectInfo == null) { return(0u); } Transform effectPos = nr3DCharBase.GetEffectPos(effectInfo.EFFECT_POS); if (null != effectPos) { v3CenterPos.y = effectPos.position.y; } NkEffectUnit kEffectUnit = new NkEffectUnit(effectInfo, nr3DCharBase.GetRootGameObject(), v3CenterPos); return(this._AddEffect(kEffectUnit)); }
public uint AddCasterEffect(string effectKind, NkBattleChar kBattleChar) { if (this.m_bDontMakeEffect && NrTSingleton <NkEffectManager> .Instance.isEffectLimit(effectKind)) { return(0u); } if (kBattleChar == null) { return(0u); } Nr3DCharBase nr3DCharBase = kBattleChar.Get3DChar(); if (nr3DCharBase == null) { return(0u); } Transform effectTarget = nr3DCharBase.GetEffectTarget(); if (effectTarget == null) { return(0u); } EFFECT_INFO effectInfo = NrTSingleton <NkEffectManager> .Instance.GetEffectInfo(effectKind); if (effectInfo == null) { return(0u); } GameObject goTarget = nr3DCharBase.GetRootGameObject(); Transform effectPos = nr3DCharBase.GetEffectPos(effectInfo.EFFECT_POS); if (null != effectPos && effectInfo.EFFECT_POS == eEFFECT_POS.CENTERDM) { goTarget = effectPos.gameObject; } NkEffectUnit kEffectUnit; if (effectInfo.EFFECT_POS == eEFFECT_POS.CENTERDM) { kEffectUnit = new NkEffectUnit(effectInfo, goTarget); } else { kEffectUnit = new NkEffectUnit(effectInfo, kBattleChar); } return(this._AddEffect(kEffectUnit)); }
public NkEffectUnit(EFFECT_INFO effectInfo, NkBattleChar OrderChar, Vector3 v3CenterTarget) { GameObject goParent = null; Nr3DCharBase nr3DCharBase = OrderChar.Get3DChar(); if (nr3DCharBase != null) { goParent = nr3DCharBase.GetRootGameObject(); } Transform effectPos = nr3DCharBase.GetEffectPos(effectInfo.EFFECT_POS); if (null != effectPos) { v3CenterTarget.y = effectPos.position.y; } this.m_CasterChar = OrderChar; this.InitBase(eEFFECT_TARGET.POSITION, effectInfo, goParent, v3CenterTarget); }
public override void Update() { base.Update(); this.OnGeneralTouchCallback(); if (this.m_TargetChar != null && this.m_TargetChar.CastedTarget != null) { Nr3DCharBase nr3DCharBase = this.m_TargetChar.CastedTarget.Get3DChar(); if (nr3DCharBase != null) { Vector2 zero = Vector2.zero; Vector2 zero2 = Vector2.zero; Vector3 pos = Vector3.zero; pos = nr3DCharBase.GetRootGameObject().transform.position; pos = GUICamera.WorldToEZ(pos); zero = new Vector2(pos.x, pos.y - 150f); zero2 = new Vector2(pos.x - 20f, pos.y - 190f); this.Move(zero, zero2); } } if (this._ScreenWidth != GUICamera.width || this._ScreenHeight != GUICamera.height) { this.ResizeDlg(); } if (this.m_nOtherWinID != G_ID.NONE) { Form form = NrTSingleton <FormsManager> .Instance.GetForm(this.m_nOtherWinID); if (form != null) { form.SetLocation(form.GetLocationX(), form.GetLocationY(), NrTSingleton <FormsManager> .Instance.GetTopMostZ() - 1f); } } if (!this.bAutoClose) { return; } if (Time.realtimeSinceStartup > this.fCloseTime) { this.Close(); } }
public uint AddEffectByTarget(string effectKind, NrCharBase kCharBase, Vector3 diffPos) { 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); } NkEffectUnit kEffectUnit = new NkEffectUnit(effectInfo, nr3DCharBase.GetRootGameObject(), diffPos); return(this._AddEffect(kEffectUnit)); }