//掉线 void Offline(UnityEngine.GameObject go, SharedGameObjectInfo share_info) { if (null != go && null != share_info) { if (share_info != null) { UnityEngine.Transform tf; tf = go.transform.Find("portrait"); if (tf != null) { UISprite us = transform.gameObject.GetComponent <UISprite>(); if (us != null) { if (share_info.IsDead) { us.color = color2; } else { us.color = color1; } } } } } }
public static int GetFinalSkill(GameObject source, int skillid) { int result = skillid; SharedGameObjectInfo si = LogicSystem.GetSharedGameObjectInfo(source); int break_protector = 10000; if (si != null && (si.IsSimulate || si.IsSummonWithAI)) { return(skillid); } while (si != null) { if (si.SummonOwnerActorId >= 0) { result = si.SummonOwnerSkillId; si = LogicSystem.GetSharedGameObjectInfo(si.SummonOwnerActorId); if (si != null && (si.IsSimulate || si.IsSummonWithAI)) { break; } } else { break; } if (break_protector-- <= 0) { break; } } return(result); }
public static List <GameObject> FindTargetInProgeny(UnityEngine.Vector3 center, float radius, GameObject ancestor, int signforskill, float degree) { List <GameObject> golist = new List <GameObject>(); List <GameObject> result = new List <GameObject>(); GetProgenyGameObject(ancestor, golist); UnityEngine.Vector3 direction = ancestor.transform.forward; direction.y = 0; for (int i = 0; i < golist.Count; ++i) { GameObject obj = golist[i]; if (obj != null && UnityEngine.Vector3.Distance(obj.transform.position, center) <= radius) { UnityEngine.Vector3 targetDir = obj.transform.position - ancestor.transform.position; targetDir.y = 0; if (UnityEngine.Mathf.Abs(UnityEngine.Vector3.Angle(targetDir, direction)) <= degree) { SharedGameObjectInfo sgoi = LogicSystem.GetSharedGameObjectInfo(obj); if (sgoi != null && sgoi.SignForSkill == signforskill) { result.Add(obj); } } } } return(result); }
public int GetTouchObjID() { int object_id = -1; float skill_blear_radius = 0.5f; Vector3 touch_pos = new Vector3(position.x, position.y, 0); Ray ray = Camera.main.ScreenPointToRay(touch_pos); RaycastHit hitInfo; GameObject hitGameObj = null; int layermask = (1 << LayerMask.NameToLayer("Terrains")) | (1 << LayerMask.NameToLayer("Character")); SkillControllerInterface player_skill_ctrl = GetControl(); if (null != player_skill_ctrl) { SkillInputData skill_input_data = player_skill_ctrl.GetSkillInputData(SkillTags); if (null != skill_input_data) { skill_blear_radius = skill_input_data.targetChooseRange; } } if (Physics.Raycast(ray, out hitInfo, 200f, layermask)) { Collider[] hitObjs = Physics.OverlapSphere(hitInfo.point, skill_blear_radius, (1 << LayerMask.NameToLayer("Character"))); if (hitObjs.Length > 0) { hitGameObj = hitObjs[0].gameObject; if (null != hitGameObj) { SharedGameObjectInfo targetInfo = LogicSystem.GetSharedGameObjectInfo(hitGameObj); if (null != targetInfo && IsEnemy()) { // camp int camp_self = -1; GameObject goSelf = DashFire.LogicSystem.PlayerSelf; if (null != goSelf) { CharacterCamp camp_s = goSelf.GetComponent <CharacterCamp>(); if (null != camp_s) { camp_self = camp_s.m_CampId; } } CharacterCamp camp_t = hitGameObj.GetComponent <CharacterCamp>(); if (camp_t != null && camp_self != camp_t.m_CampId && targetInfo.Blood > 0) { object_id = targetInfo.m_LogicObjectId; } } } } } if (-1 != object_id && null != hitGameObj) { GfxSystem.PublishGfxEvent("Op_InputEffect", "Input", GestureEvent.OnSingleTap, hitGameObj.transform.position.x, hitGameObj.transform.position.y, hitGameObj.transform.position.z, true, false); } return(object_id); }
public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime) { if (curSectionTime < m_StartTime) { return(true); } if (curSectionTime > (m_StartTime + m_RemainTime)) { return(false); } GameObject obj = sender as GameObject; if (obj == null) { return(false); } if (!m_IsInited) { m_IsInited = true; m_SkillInstance = instance; SharedGameObjectInfo sgoi = LogicSystem.GetSharedGameObjectInfo(obj); if (sgoi != null) { sgoi.HandleEventCheckHitCanRelease = CheckHitCanRelease; } } return(true); }
public void SendImpact(GameObject sender, GameObject target, ImpactInfo impactInfo, int hitCount = 1) { SendImpactWithOutDamage(target, impactInfo); SharedGameObjectInfo targetInfo = LogicSystem.GetSharedGameObjectInfo(target); LogicSystem.NotifyGfxHitTarget(sender, impactInfo.m_ImpactId, target, hitCount); }
public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime) { if (curSectionTime < m_StartTime) { return(true); } UnityEngine.GameObject obj = sender as UnityEngine.GameObject; if (obj == null) { return(false); } SharedGameObjectInfo owner_info = LogicSystem.GetSharedGameObjectInfo(obj); if (owner_info.Summons.Count <= 0) { return(false); } UnityEngine.GameObject first_summon = LogicSystem.GetGameObject(owner_info.Summons[0]); if (first_summon == null) { return(false); } UnityEngine.Vector3 summon_pos = first_summon.transform.position; first_summon.transform.position = obj.transform.position; obj.transform.position = summon_pos; LogicSystem.NotifyGfxUpdatePosition(obj, obj.transform.position.x, obj.transform.position.y, obj.transform.position.z); LogicSystem.NotifyGfxUpdatePosition(first_summon, first_summon.transform.position.x, first_summon.transform.position.y, first_summon.transform.position.z); return(false); }
private List <int> GetSummonList(GameObject obj) { List <int> result = new List <int>(); SharedGameObjectInfo share_info = LogicSystem.GetSharedGameObjectInfo(obj); if (share_info == null) { return(result); } if (!m_IsSummon) { result.AddRange(share_info.Summons); } else if (share_info.SummonOwnerActorId >= 0) { SharedGameObjectInfo owner_info = LogicSystem.GetSharedGameObjectInfo(share_info.SummonOwnerActorId); if (owner_info != null) { for (int i = 0; i < owner_info.Summons.Count; ++i) { int actorid = owner_info.Summons[i]; if (actorid != share_info.m_ActorId) { result.Add(actorid); } } } } return(result); }
/**点击玩家 弹出加好友,组队功能界面*/ void OnCheckPlayerInfo(int actorid) { try { SharedGameObjectInfo share_info = ArkCrossEngine.LogicSystem.GetSharedGameObjectInfo(actorid); GfxUserInfo userInfo; bool sign = true; for (int i = 0; i < DFMUiRoot.GfxUserInfoListForUI.Count; i++) { if (DFMUiRoot.GfxUserInfoListForUI[i].m_ActorId == actorid) { sign = false; userInfo = DFMUiRoot.GfxUserInfoListForUI[i]; UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("DynamicFriend"); if (null != go) { go.GetComponent <DynamicFriend>().InitPanel(userInfo, new UnityEngine.Vector3()); } LogicSystem.PublishLogicEvent("ge_request_player_info", "lobby", userInfo.m_Nick); break; } } if (sign) { GfxSystem.PublishGfxEvent("ge_screen_tip", "ui", ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(557), UIScreenTipPosEnum.AlignCenter, UnityEngine.Vector3.zero); } } catch (Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
protected string GetAnimationNameByType(GameObject obj, Animation_Type type) { if (null == obj) { return(null); } SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(obj); if (null != info) { Data_ActionConfig curActionConfig = ActionConfigProvider.Instance.ActionConfigMgr.GetDataById(info.AnimConfigId); return(curActionConfig.m_ActionAnimNameContainer[type]); //Data_ActionConfig.Data_ActionInfo action = null; //if (null != curActionConfig && curActionConfig.m_ActionContainer.ContainsKey(type)) { // if (curActionConfig.m_ActionContainer[type].Count > 0) { // action = curActionConfig.m_ActionContainer[type][0]; // } //} //if (null != action) { // return action.m_AnimName; //} } return(null); }
private IEnumerator EndGame() { // 关掉输入和移动 TouchManager.TouchEnable = false; GameObject player = GetPlayer(); if (null != player) { SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(gameObject); if (null != info) { LogicSystem.PublishLogicEvent("ge_set_ai_enable", "ai", info.m_LogicObjectId, false); } } // 慢放 3s Time.timeScale = 0.1f; yield return(new WaitForSeconds(0.3f)); Time.timeScale = 1.0f; // stage clear OnStageClear(); player = GetPlayer(); if (null != player) { BaseSkillManager bsm = player.GetComponent <BaseSkillManager>(); if (null != bsm) { if (!bsm.IsUsingSkill()) { } else { SkillControllerInterface sc = bsm.GetSkillController(); if (null != sc) { sc.ForceStopCurSkill(); } } } } yield return(new WaitForSeconds(0.9f)); // 耍帅动作 GameObject gfxGameRoot = GameObject.Find("GfxGameRoot"); MainCamera cameraControl = gfxGameRoot.GetComponent <MainCamera>(); cameraControl.m_Distance = 10.0f; cameraControl.m_Height = 7.0f; player = GetPlayer(); if (null != player) { player.GetComponent <Animation>().PlayQueued("jianshi_shenguizhan_01", QueueMode.PlayNow); } yield return(new WaitForSeconds(1.2f)); cameraControl.m_Distance = 12.5f; cameraControl.m_Height = 7.9f; TouchManager.TouchEnable = true; OnShieldSword(); }
public virtual void UpdateEffect(ImpactLogicInfo logicInfo) { if (null == logicInfo.Target) { return; } SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(logicInfo.Target); if (null != shareInfo && !shareInfo.AcceptStiffEffect) { return; } for (int i = 0; i < logicInfo.EffectList.Count; ++i) { EffectInfo effectInfo = logicInfo.EffectList[i]; if (null != effectInfo) { if (effectInfo.StartTime < 0 && Time.time > logicInfo.StartTime + effectInfo.DelayTime / 1000) { effectInfo.IsActive = true; effectInfo.StartTime = Time.time; GameObject obj = ResourceSystem.NewObject(effectInfo.Path, effectInfo.PlayTime / 1000) as GameObject; if (null != obj) { if (effectInfo.DelWithImpact) { logicInfo.EffectsDelWithImpact.Add(obj); } if (String.IsNullOrEmpty(effectInfo.MountPoint)) { obj.transform.position = logicInfo.Target.transform.position + effectInfo.RelativePoint; UnityEngine.Quaternion q = UnityEngine.Quaternion.Euler(effectInfo.RelativeRotation.x, effectInfo.RelativeRotation.y, effectInfo.RelativeRotation.z); if (effectInfo.RotateWithTarget && null != logicInfo.Sender) { obj.transform.rotation = UnityEngine.Quaternion.LookRotation(logicInfo.Target.transform.position - logicInfo.Sender.transform.position, UnityEngine.Vector3.up); obj.transform.rotation = UnityEngine.Quaternion.Euler(obj.transform.rotation.eulerAngles + effectInfo.RelativeRotation); } else { obj.transform.rotation = q; } } else { Transform parent = LogicSystem.FindChildRecursive(logicInfo.Target.transform, effectInfo.MountPoint); if (null != parent) { obj.transform.parent = parent; obj.transform.localPosition = UnityEngine.Vector3.zero; UnityEngine.Quaternion q = UnityEngine.Quaternion.Euler(ImpactUtility.RadianToDegree(effectInfo.RelativeRotation.x), ImpactUtility.RadianToDegree(effectInfo.RelativeRotation.y), ImpactUtility.RadianToDegree(effectInfo.RelativeRotation.z)); obj.transform.localRotation = q; } } } } } } }
protected void ClearGfxStateFlag(GameObject obj) { SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(obj); if (null != shareInfo) { shareInfo.GfxStateFlag = 0; } }
public override void StartImpact(ImpactLogicInfo logicInfo) { LogicSystem.NotifyGfxAnimationStart(logicInfo.Target, false); SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(logicInfo.Target); PlayAnimation(logicInfo.Target, Animation_Type.AT_Grab); LogicSystem.NotifyGfxMoveControlStart(logicInfo.Target, logicInfo.ImpactId, false); SetGfxStateFlag(logicInfo.Target, Operate_Type.OT_AddBit, GfxCharacterState_Type.Grab); }
//更新怒气值 public void UpdateAngryValue() { SharedGameObjectInfo share_info = LogicSystem.PlayerSelfInfo; if (share_info != null) { float value = share_info.Rage / share_info.MaxRage; float spTempValue = value; if (value > 0.9f && value < 1f) { //让玩家更容易分辨出当前为怒气未满状态 spTempValue = 0.9f; } if (spAgeryValueEx != null) { spAgeryValueEx.fillAmount = spTempValue; } //增加一个判断条件:等loading界面结束 if (value >= 1 && spFullEx != null && UIDataCache.Instance.isLoadingEnd) { if (NGUITools.GetActive(spAshEx.gameObject) && m_IsInNewbieGuide == false) { //第一次释放技能,需要新手引导 m_IsInNewbieGuide = true; m_IsNeedLockGameFrame = true; SetLockFrame(true); } if (spAgeryValueEx != null) { spAgeryValueEx.fillAmount = 1f; } NGUITools.SetActive(spFullEx.gameObject, true); //播放特效 if (goEffect != null && m_RuntimeEffect == null && spAshEx != null && NGUITools.GetActive(spAshEx.gameObject)) { m_RuntimeEffect = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ResourceSystem.NewObject(goEffect)); if (m_RuntimeEffect != null) { m_RuntimeEffect.transform.position = spFullEx.transform.position; } } } else { if (spFullEx != null) { NGUITools.SetActive(spFullEx.gameObject, false); if (m_RuntimeEffect != null) { Destroy(m_RuntimeEffect); m_RuntimeEffect = null; } } } } }
protected int GetLogicId(GameObject obj) { SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(gameObject); if (null != info) { return(info.m_LogicObjectId); } return(-1); }
public static bool IsTouching(GameObject obj) { SharedGameObjectInfo share_info = LogicSystem.GetSharedGameObjectInfo(obj); if (share_info == null || !share_info.IsTouchDown) { return(false); } return(true); }
protected bool IsAlive() { SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(gameObject); if (null != info && info.Blood > 0.0f) { return(true); } return(false); }
protected bool IsLogicDead() { SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(gameObject); if (null != info) { return(info.Blood <= 0); } return(true); }
public static bool IsGameObjectSupperArmer(GameObject target) { SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(target); if (info == null) { return(false); } return(info.IsSuperArmor); }
public override void OnInterrupted(ImpactLogicInfo logicInfo) { StopAnimation(logicInfo.Target, (Animation_Type)logicInfo.ActionType); SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(logicInfo.Target); if (null != shareInfo) { shareInfo.GfxStateFlag = shareInfo.GfxStateFlag & ~((int)GfxCharacterState_Type.Stiffness); } logicInfo.IsActive = false; GeneralStopImpact(logicInfo); }
public override void StartImpact(ImpactLogicInfo logicInfo) { GeneralStartImpact(logicInfo); logicInfo.ActionType = GetStiffnessAction(logicInfo); SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(logicInfo.Target); if (null != shareInfo) { shareInfo.GfxStateFlag = shareInfo.GfxStateFlag | (int)GfxCharacterState_Type.Stiffness; } PlayAnimation(logicInfo.Target, (Animation_Type)logicInfo.ActionType); }
private void StoreTouchPos(GameObject obj, SkillInstance instance) { UnityEngine.Vector3 touchpos = TriggerUtil.GetTouchPos(obj); UnityEngine.Vector3 scene_pos = CalcScenePos(obj, touchpos); SharedGameObjectInfo obj_info = LogicSystem.GetSharedGameObjectInfo(obj); if (obj_info != null) { obj_info.LastTouchX = scene_pos.x; obj_info.LastTouchY = scene_pos.y; obj_info.LastTouchZ = scene_pos.z; } }
public static bool IsObjectDead(GameObject obj) { SharedGameObjectInfo si = LogicSystem.GetSharedGameObjectInfo(obj); if (si.Blood <= 0) { return(true); } else { return(false); } }
protected void SetGfxDead(GameObject obj, bool isDead) { if (null != obj) { SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(obj); { if (null != shareInfo) { shareInfo.IsDead = isDead; } } } }
protected void StopSpell(GameObject obj) { SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(obj); GameObject uiRoot = GameObject.FindGameObjectWithTag("UI"); if (null != uiRoot && null != info) { DFMUiRoot uiMgr = uiRoot.GetComponent <DFMUiRoot>(); if (null != uiMgr) { uiMgr.BreakPrePower(info.m_LogicObjectId); } } }
protected void GeneralStartSkill() { m_IsActive = true; m_LastTriggerTime = Time.time; m_EffectList.Clear(); SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(gameObject); if (null != info) { LogicSystem.PublishLogicEvent("ge_set_ai_enable", "ai", info.m_LogicObjectId, false); } LogicSystem.NotifyGfxAnimationStart(gameObject); LogicSystem.NotifyGfxMoveControlStart(gameObject); }
public static bool IsUserStandUp(GameObject obj) { SharedGameObjectInfo objinfo = LogicSystem.GetSharedGameObjectInfo(obj); if (objinfo == null) { return(false); } if (objinfo.IsPlayer && objinfo.GfxStateFlag == (int)GfxCharacterState_Type.GetUp) { return(true); } return(false); }
protected bool IsGfxDead(GameObject obj) { if (null != obj) { SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(obj); { if (null != shareInfo) { return(shareInfo.IsDead); } } } return(true); }
protected bool IsLogicDead(GameObject obj) { if (null != obj) { SharedGameObjectInfo shareInfo = LogicSystem.GetSharedGameObjectInfo(obj); { if (null != shareInfo && shareInfo.Blood > 0) { return(false); } } } return(true); }