本文整理汇总了C#中SkillSystem.SkillInstance.SetVariable方法的典型用法代码示例。如果您正苦于以下问题:C# SkillInstance.SetVariable方法的具体用法?C# SkillInstance.SetVariable怎么用?C# SkillInstance.SetVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkillSystem.SkillInstance
的用法示例。
在下文中一共展示了SkillInstance.SetVariable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
foreach (var pair in m_Params) {
instance.SetVariable(pair.Key, pair.Value);
}
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
public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
{
GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
if (null == senderObj) return false;
EntityInfo obj = senderObj.GfxObj;
if (null == obj) return false;
if (curSectionTime < StartTime)
return true;
instance.SetVariable("hitEffect", SkillParamUtility.RefixResourceVariable(m_HitEffect, instance, senderObj.ConfigData.resources));
instance.SetVariable("hitEffectBone", m_HitEffectBone);
instance.SetVariable("hitEffectStartTime", m_HitEffectStartTime);
instance.SetVariable("hitEffectDeleteTime", m_HitEffectDeleteTime);
instance.SetVariable("hitAnim", m_HitAnim);
instance.SetVariable("hitAnimTime", m_HitAnimTime);
instance.SetVariable("hitDelayTime", m_HitDelayTime);
return false;
}
示例4: 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里使用
}
GameObject obj = senderObj.GfxObj;
if (null != obj) {
if (curSectionTime >= StartTime) {
if (!m_IsStarted) {
m_IsStarted = true;
Vector3 dest;
string trackBone = m_TrackBone.Get(instance);
m_BoneTransform = Utility.FindChildRecursive(obj.transform, trackBone);
if (null != m_BoneTransform) {
dest = m_BoneTransform.position;
} else {
dest = obj.transform.position;
dest.y += 1.5f;
LogSystem.Warn("[skill:{0} dsl skill id:{1}] track bone {2} can't find.", senderObj.SkillId, instance.DslSkillId, trackBone);
}
m_StartPos = EntityController.Instance.GetImpactSenderPosition(senderObj.ActorId, senderObj.SkillId, senderObj.Seq);
dest = Utility.FrontOfTarget(m_StartPos, dest, 0.1f);
object speedObj;
if (instance.Variables.TryGetValue("emitSpeed", out speedObj)) {
m_Speed = (float)speedObj;
} else {
return false;
}
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);
//.........这里部分代码省略.........