private void OnTrigger() { //try get target var param = m_ActionPlayer.GetActionParam(); if (null != param && null != param.Object && param.Object is FuncContext) { FuncContext context = param.Object as FuncContext; var userInstance = (EFuncTarget)(m_FrameConfig.TargetType) == EFuncTarget.EFT_Target ? (context.Get(FuncContext.ContextKey.Target) as Ilife) : (context.Get(FuncContext.ContextKey.User) as Ilife); if (null == userInstance) { //target is null return; } var obj = ((CharTransformData)(((ITransformBehaviour)(userInstance)).GetTransformData())).GetGameObject(); uint id = uint.Parse(m_FrameConfig.InstanceId); GameObject objInstance = EffectContainer.EffectFactory(m_FrameConfig.EffectName, id); objInstance.transform.position = obj.transform.position + m_FrameConfig.Pos.GetVector3(); objInstance.transform.eulerAngles = obj.transform.eulerAngles + m_FrameConfig.Rot.GetVector3(); } }
private void OnTrigger() { //try get target var param = m_ActionPlayer.GetActionParam(); if (null != param && null != param.Object && param.Object is FuncContext) { FuncContext context = param.Object as FuncContext; Ilife userInstance = context.Get(FuncContext.ContextKey.Target) as Ilife; if (null == userInstance) { return; } m_TargetObj = ((CharTransformData)(((ITransformBehaviour)(userInstance)).GetTransformData())).GetGameObject(); m_EffectObj = EffectContainer.GetInstance(uint.Parse(m_FrameConfig.InstanceId)); m_vTargetPos = m_TargetObj.transform.position; m_fLeftTime = (float)(m_FrameConfig.Time); m_fHigh = (float)(m_FrameConfig.High); m_fInitTime = TimeManager.Instance.GetTime(); m_fLastTime = m_fInitTime; m_fLastVx = Vector3.Distance(m_EffectObj.transform.position, m_vTargetPos) / m_fLeftTime; m_fLastVy = (float)(0.5f * 9.8 * m_fLeftTime); m_vInitPos = m_EffectObj.transform.position; m_vDir = m_vTargetPos - m_vInitPos; m_vDeltaSpace.Normalize(); m_bIsRunning = true; } }
private void OnTrigger() { //try get target var param = m_ActionPlayer.GetActionParam(); if (null != param && null != param.Object && param.Object is FuncContext) { FuncContext context = param.Object as FuncContext; if (!context.ContainsKey(FuncContext.ContextKey.LimitId) || !context.ContainsKey(FuncContext.ContextKey.FunctionId)) { return; } int limitId = (int)(context.Get(FuncContext.ContextKey.LimitId)); int funcId = (int)(context.Get(FuncContext.ContextKey.LimitId)); HandleTarget target = null; Ilife user = context.Get(FuncContext.ContextKey.User) as Ilife; if (context.ContainsKey(FuncContext.ContextKey.Target)) { //locked skill target = HandleTarget.GetHandleTarget(user, context.Get(FuncContext.ContextKey.Target) as Ilife); } else { //target is null,unlocked skill int targetId = (int)(context.Get(FuncContext.ContextKey.TargetId)); target = TargetMethods.GetTargetList(user, targetId, null); } //exec attack if (LimitMethods.HandleLimitExec(target, limitId, null)) { FuncMethods.HandleFuncExec(target, funcId, null); } } }