/// param:Id[对应到SkillSceneObjManager中的SkillEffectId] /// example:2 public void Trigger_PlayEffectAtWeaponByEffectId(string param) { #if SHOOTER_LOG Debug.Log("Trigger_PlayEffectAtWeaponByEffectId param:" + param); #endif SkillSceneObjInfo sobjInfo = new SkillSceneObjInfo(param); MasterWeaponType masterType = (MasterWeaponType)(sobjInfo.ExtractNumeric <int>(0, 0)); GameObject curMainWeapon = TriggerImpl.GetCurMainWeapon(this.gameObject, masterType); if (m_SceneObjMgr != null && curMainWeapon != null) { SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id); if (effectInfo != null) { effectInfo = effectInfo.Clone(); Vector3 pos = curMainWeapon.transform.position; Vector3 rot = curMainWeapon.transform.rotation.eulerAngles; if (!string.IsNullOrEmpty(effectInfo.EffectParentBone)) { Transform t = LogicSystem.FindChildRecursive(curMainWeapon.transform, effectInfo.EffectParentBone); if (null != t) { pos = t.position; } } effectInfo.EffectPos += pos; effectInfo.EffectRot += rot; TriggerImpl.PlayEffect(effectInfo); } } }
public static float GetWeaponHeight(GameObject target, MasterWeaponType masterType = MasterWeaponType.Master) { GameObject curWeapon = GetCurMainWeapon(target, masterType); if (curWeapon != null) { return(Mathf.Abs(target.transform.position.y - curWeapon.transform.position.y)); } return(0.0f); }
public GameObject GetCurMainWeapon(MasterWeaponType masterType = MasterWeaponType.Master) { SkillWeaponInfo info = GetCurMainWeaponInfo(masterType); if (info == null) { return(null); } return(GetWeaponByHand(info.HoldType)); }
public static int GetCurWeaponId(GameObject target, MasterWeaponType masterType = MasterWeaponType.Master) { WeaponControl control = target.GetComponent <WeaponControl>(); if (control == null) { LogicSystem.GfxLog("ShooterSkillExecutor GetCurWeaponId Script miss!"); return(-1); } return(control.GetCurWeaponId(masterType)); }
/// param:Id[对应到SkillSceneObjManager中的SkillEffectId] /// example:2 public void Trigger_AttachEffectAtWeaponByEffectId(string param) { #if SHOOTER_LOG Debug.Log("Trigger_AttachEffectAtWeaponByEffectId param:" + param); #endif SkillSceneObjInfo sobjInfo = new SkillSceneObjInfo(param); MasterWeaponType masterType = (MasterWeaponType)(sobjInfo.ExtractNumeric <int>(0, 0)); GameObject curMainWeapon = TriggerImpl.GetCurMainWeapon(this.gameObject, masterType); if (m_SceneObjMgr != null && curMainWeapon != null) { SkillEffectInfo effectInfo = m_SceneObjMgr.TryGetSkillEffectInfo(sobjInfo.Id); if (effectInfo != null) { effectInfo = effectInfo.Clone(); effectInfo.EffectParent = curMainWeapon.transform; TriggerImpl.AttachEffect(effectInfo); } } else { Debug.Log("Trigger_AttachEffectAtWeaponByEffectId null"); } }
/// param:Id[对应到SkillSceneObjManager中的AttractBullet Id] /// example:1 public void Trigger_AttractShoot(string param) { #if SHOOTER_LOG Debug.Log("Trigger_AttractShoot param:" + param); #endif if (m_SceneObjMgr != null) { SkillSceneObjInfo sobjInfo = new SkillSceneObjInfo(param); SceneObject_AttractBulletInfo bulletInfo = m_SceneObjMgr.TryGetAttractBulletInfo(sobjInfo.Id); MasterWeaponType masterType = (MasterWeaponType)(sobjInfo.ExtractNumeric <int>(0, 0)); GameObject curMainWeapon = TriggerImpl.GetCurMainWeapon(this.gameObject, masterType); if (bulletInfo != null && bulletInfo.SceneObjInfo != null && curMainWeapon != null) { Transform efSpark = LogicSystem.FindChildRecursive(curMainWeapon.transform, Script_Util.ForceNotifyEffectBone(bulletInfo.SceneObjInfo.EffectParentBone)); if (null == efSpark) { Debug.Log("Trigger_AttractShoot bone miss!"); return; } bulletInfo = bulletInfo.Clone(); bulletInfo.Attacker = this.gameObject; bulletInfo.SceneObjInfo.EffectPos += efSpark.transform.position; bulletInfo.MoveStartPos += efSpark.transform.position; bulletInfo.MoveDir = Quaternion.Euler(efSpark.transform.rotation.eulerAngles + bulletInfo.MoveDir) * Vector3.forward; bulletInfo.SceneObjInfo.EffectLiftTime = float.MaxValue; bulletInfo.ImpactSrcPos += new Vector3(gameObject.transform.position.x, efSpark.transform.position.y, gameObject.transform.position.z); GameObject tBulletObj = TriggerImpl.PlayEffect(bulletInfo.SceneObjInfo); tBulletObj.SendMessage("Active", bulletInfo); } else { Debug.Log("Trigger_AttractShoot null!"); } } }
public int GetCurWeaponId(MasterWeaponType masterType = MasterWeaponType.Master) { return((masterType == MasterWeaponType.Master) ? m_CurWeaponId : m_CurSubWeaponId); }
public int GetWeaponId(MasterWeaponType master = MasterWeaponType.Master) { return((master == MasterWeaponType.Master)? WeaponId : SubWeaponId); }