本文整理汇总了C#中SkillSystem.SkillInstance.StopCurSection方法的典型用法代码示例。如果您正苦于以下问题:C# SkillInstance.StopCurSection方法的具体用法?C# SkillInstance.StopCurSection怎么用?C# SkillInstance.StopCurSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillSystem.SkillInstance
的用法示例。
在下文中一共展示了SkillInstance.StopCurSection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
{
GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
if (null == senderObj) return false;
Scene scene = senderObj.Scene;
EntityInfo obj = senderObj.GfxObj;
if (null == obj) return false;
if (curSectionTime < StartTime) {
return true;
}
if (m_HaveIsContinue) {
if (0 == m_Type.CompareTo("shield")) {
if (scene.EntityController.HaveShield(senderObj.ActorId))
return true;
} else {
if (scene.EntityController.HaveState(senderObj.ActorId, m_Type))
return true;
}
} else {
if (0 == m_Type.CompareTo("shield")) {
if (!scene.EntityController.HaveShield(senderObj.ActorId))
return true;
} else {
if (!scene.EntityController.HaveState(senderObj.ActorId, m_Type))
return true;
}
}
instance.StopCurSection();
return false;
}
示例2: Execute
public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
{
GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
if (null == senderObj) {
return false;
}
if (senderObj.ConfigData.type == (int)SkillOrImpactType.Skill) {
return false;//track只能在impact或buff里使用
}
Scene scene = senderObj.Scene;
EntityInfo obj = senderObj.GfxObj;
if (null != obj) {
if (curSectionTime >= StartTime) {
if (!m_IsStarted) {
m_IsStarted = true;
Vector3 dest = obj.GetMovementStateInfo().GetPosition3D();
dest.Y += 1.5f;
Vector3 pos = scene.EntityController.GetImpactSenderPosition(senderObj.ActorId, senderObj.SkillId, senderObj.Seq);
object speedObj;
if (instance.Variables.TryGetValue("emitSpeed", out speedObj)) {
m_Speed = (float)speedObj;
} else {
return false;
}
float duration = m_Duration;
if (duration > Geometry.c_FloatPrecision) {
float d = duration / 1000.0f;
m_Lifetime = d;
m_Speed = (dest - m_StartPos).Length() / m_Lifetime;
} else {
m_Lifetime = 1.0f;
if (m_Speed > Geometry.c_FloatPrecision) {
m_Lifetime = (dest - m_StartPos).Length() / m_Speed;
}
}
} else if (curSectionTime > StartTime + (long)(m_Lifetime * 1000)) {
m_HitEffectRotation = Quaternion.Identity;
if (m_NoImpact) {
instance.SetVariable("hitEffectRotation", m_HitEffectRotation);
} else {
int impactId = scene.EntityController.GetTrackSendImpact(senderObj.ActorId, senderObj.Seq, instance.Variables);
Dictionary<string, object> args;
TriggerUtil.CalcImpactConfig(0, impactId, instance, senderObj.ConfigData, out args);
if (args.ContainsKey("hitEffectRotation"))
args["hitEffectRotation"] = m_HitEffectRotation;
else
args.Add("hitEffectRotation", m_HitEffectRotation);
scene.EntityController.TrackSendImpact(senderObj.ActorId, senderObj.SkillId, senderObj.Seq, impactId, args);
int senderId, targetId;
scene.EntityController.CalcSenderAndTarget(senderObj, out senderId, out targetId);
}
instance.StopCurSection();
return false;
}
//GameFramework.LogSystem.Debug("EmitEffectTriger:{0}", m_EffectPath);
return true;
} else {
return true;
}
} else {
instance.StopCurSection();
return false;
}
}
示例3: Execute
//.........这里部分代码省略.........
float duration = m_Duration.Get(instance);
if (duration > Geometry.c_FloatPrecision) {
float d = duration / 1000.0f;
m_Lifetime = d;
m_Speed = (dest - m_StartPos).magnitude / m_Lifetime;
} else {
m_Lifetime = 1.0f;
if (m_Speed > Geometry.c_FloatPrecision) {
m_Lifetime = (dest - m_StartPos).magnitude / m_Speed;
}
}
long newSectionDuration = StartTime + (long)(m_Lifetime * 1000);
if (instance.CurSectionDuration < newSectionDuration) {
instance.SetCurSectionDuration(newSectionDuration);
}
Quaternion dir;
object dirObj;
if (instance.Variables.TryGetValue("emitDir", out dirObj)) {
dir = (Quaternion)dirObj;
} else {
dir = Quaternion.identity;
}
Vector3 scale;
object scaleObj;
if (instance.Variables.TryGetValue("emitScale", out scaleObj)) {
scale = (Vector3)scaleObj;
} else {
scale = Vector3.one;
}
Vector3 lookDir = dest - m_StartPos;
Quaternion q = Quaternion.LookRotation(lookDir);
m_ControlPos = m_StartPos + Vector3.Scale(q * dir * Vector3.forward, scale * lookDir.magnitude * 0.5f);
string effectPath = SkillParamUtility.RefixResourceVariable("emitEffect", instance, senderObj.ConfigData.resources);
m_Effect = ResourceSystem.Instance.NewObject(effectPath, m_Lifetime) as GameObject;
if (null != m_Effect) {
senderObj.TrackEffectObj = m_Effect;
TriggerUtil.SetObjVisible(m_Effect, true);
m_Effect.SetActive(false);
m_Effect.transform.position = m_StartPos;
m_Effect.transform.localRotation = q;
m_Effect.SetActive(true);
} else {
if (string.IsNullOrEmpty(effectPath)) {
LogSystem.Warn("[skill:{0} dsl skill id:{1}] track effect is empty.", senderObj.SkillId, instance.DslSkillId);
} else {
LogSystem.Warn("[skill:{0} dsl skill id:{1}] track effect {2} can't find.", senderObj.SkillId, instance.DslSkillId, effectPath);
}
}
} else if (null != m_Effect) {
if (!m_NotMove && !m_IsHit) {
Vector3 dest;
if (null != m_BoneTransform) {
dest = m_BoneTransform.position;
} else {
dest = obj.transform.position;
dest.y += 1.5f;
}
dest = Utility.FrontOfTarget(m_StartPos, dest, 0.1f);
//m_Effect.transform.position = Vector3.MoveTowards(m_Effect.transform.position, dest, m_RealSpeed * Time.deltaTime);
m_Effect.transform.position = Utility.GetBezierPoint(m_StartPos, m_ControlPos, dest, (curSectionTime - StartTime) / 1000.0f / m_Lifetime);
if ((dest - m_Effect.transform.position).sqrMagnitude <= 0.01f) {
m_HitEffectRotation = Quaternion.LookRotation(m_StartPos - dest);
if (m_NoImpact) {
instance.SetVariable("hitEffectRotation", m_HitEffectRotation);
} else {
int impactId = EntityController.Instance.GetTrackSendImpact(senderObj.ActorId, senderObj.Seq, instance.Variables);
Dictionary<string, object> args;
TriggerUtil.CalcImpactConfig(0, impactId, instance, senderObj.ConfigData, out args);
if (args.ContainsKey("hitEffectRotation"))
args["hitEffectRotation"] = m_HitEffectRotation;
else
args.Add("hitEffectRotation", m_HitEffectRotation);
EntityController.Instance.TrackSendImpact(senderObj.ActorId, senderObj.SkillId, senderObj.Seq, impactId, args);
int senderId, targetId;
EntityController.Instance.CalcSenderAndTarget(senderObj, out senderId, out targetId);
}
m_IsHit = true;
}
}
if (curSectionTime > StartTime + m_Lifetime * 1000) {
m_Effect.SetActive(false);
ResourceSystem.Instance.RecycleObject(m_Effect);
m_Effect = null;
instance.StopCurSection();
return false;
}
} else {
return false;
}
//GameFramework.LogSystem.Debug("EmitEffectTriger:{0}", m_EffectPath);
return true;
} else {
return true;
}
} else {
instance.StopCurSection();
return false;
}
}