当前位置: 首页>>代码示例>>C#>>正文


C# SkillSystem.SkillInstance类代码示例

本文整理汇总了C#中SkillSystem.SkillInstance的典型用法代码示例。如果您正苦于以下问题:C# SkillInstance类的具体用法?C# SkillInstance怎么用?C# SkillInstance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SkillInstance类属于SkillSystem命名空间,在下文中一共展示了SkillInstance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
     GameObject obj = senderObj.GfxObj;
     if (null == obj) return false;
     GameObject target = senderObj.TargetGfxObj;
     if (null != senderObj.TrackEffectObj) {
         obj = senderObj.TrackEffectObj;
         target = senderObj.GfxObj;
     }
     if (curSectionTime < StartTime) {
         return true;
     }
     if (m_IsForRoundMove) {
         Vector3 srcPos = obj.transform.position;
         Vector3 targetPos = Vector3.zero;
         if (null != target) {
             targetPos = target.transform.position;
         }
         TriggerUtil.GetSkillStartPosition(srcPos, senderObj.ConfigData, instance, senderObj.ActorId, senderObj.TargetActorId, ref targetPos);
         if (targetPos.sqrMagnitude > Geometry.c_FloatPrecision) {
             instance.CustomDatas.AddData<Vector3>(targetPos);
         }
     } else {
         Vector3 pos = obj.transform.position;
         instance.CustomDatas.AddData<Vector3>(pos);
     }
     return false;
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:30,代码来源:RestorePosTrigger.cs

示例2: Execute

 public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
 {
     GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
     if (null == senderObj) {
         return false;
     }
     GameObject obj = senderObj.GfxObj;
     if (obj == null) {
         return false;
     }
     if (null != senderObj.TrackEffectObj)
         obj = senderObj.TrackEffectObj;
     if (curSectionTime < StartTime) {
         return true;
     }
     Animator animator = obj.GetComponentInChildren<Animator>();
     if (animator != null) {
         float passed_ms = curSectionTime - StartTime;
         if (passed_ms > 0) {
             float old_speed = animator.speed;
             float time = animator.playbackTime;
             time -= old_speed * passed_ms / 1000.0f;
             time += m_Speed * passed_ms / 1000.0f;
             if (time < 0) {
                 time = 0;
             }
             animator.playbackTime = time;
         }
         animator.speed = m_Speed;
         if (m_IsEffectSkillTime) {
             instance.TimeScale = m_Speed;
         }
     }
     return false;
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:35,代码来源:AnimationTrigger.cs

示例3: Execute

 public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
 {
     GfxSkillSenderInfo senderObj = sender as GfxSkillSenderInfo;
     if (null == senderObj) return false;
     GameObject obj = senderObj.GfxObj;
     if (null == obj) return false;
     if (null != senderObj.TrackEffectObj) {
         obj = senderObj.TrackEffectObj;
     }
     if (!m_IsResourcePreloaded) {
         PreloadResource(obj, instance);
     }
     if (curSectionTime < StartTime) {
         return true;
     }
     if (m_IsNeedCollide) {
     }
     string random_audio = GetRandomAudio();
     AudioClip clip = ResourceSystem.Instance.GetSharedResource(random_audio) as AudioClip;
     if (null == clip) {
         return false;
     }
     if (m_AudioSource != null) {
         if (m_AudioSource.loop) {
             m_AudioSource.clip = clip;
             m_AudioSource.Play();
         } else {
             m_AudioSource.PlayOneShot(clip);
         }
         m_AudioSource.volume = m_volume;
         m_AudioSource.dopplerLevel = 0f;
     }
     return false;
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:34,代码来源:SoundTrigger.cs

示例4: Execute

        private string m_Type = "anim"; //anim/impact

        #endregion Fields

        #region Methods

        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 (0 == m_Type.CompareTo("anim")) {
            } else if (0 == m_Type.CompareTo("impact")) {
                int time = scene.EntityController.GetImpactDuration(senderObj.ActorId, senderObj.SkillId, senderObj.Seq);
                if (time > 0) {
                    instance.SetCurSectionDuration((long)time + m_DeltaTime);
                } else {
                    LogSystem.Warn("adjustsectionduration impact duration is 0, skill id:{0} dsl skill id:{1}", senderObj.SkillId, instance.DslSkillId);
                }
            } else {
                int time = TryGetTimeFromConfig(instance);
                if (time > 0) {
                    instance.SetCurSectionDuration((long)time + m_DeltaTime);
                } else {
                    LogSystem.Warn("adjustsectionduration variable time is 0, skill id:{0} dsl skill id:{1}", senderObj.SkillId, instance.DslSkillId);
                }
            }
            return false;
        }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:34,代码来源:SectionTrigger.cs

示例5: CreateTriger

 public ISkillTriger CreateTriger(Dsl.ISyntaxComponent trigerConfig, SkillInstance instance)
 {
     ISkillTriger triger = null;
     string type = trigerConfig.GetId();
     ISkillTrigerFactory factory = GetFactory(type);
     if (null != factory) {
         try {
             triger = factory.Create();
             triger.Init(trigerConfig, instance);
         } catch (Exception ex) {
             GameFramework.LogSystem.Error("triger:{0} line:{1} failed.", trigerConfig.ToScriptString(), trigerConfig.GetLine());
             throw ex;
         }
     } else {
     #if !DEBUG
         GameFramework.LogSystem.Error("CreateTriger failed, type:{0}", type);
     #endif
     }
     if (null != triger) {
         GameFramework.LogSystem.Debug("CreateTriger, type:{0} triger:{1}", type, triger.GetType().Name);
     } else {
     #if !DEBUG
         GameFramework.LogSystem.Error("CreateTriger failed, type:{0}", type);
     #endif
     }
     return triger;
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:27,代码来源:SkillTrigerManager.cs

示例6: AoeQuery

 public static void AoeQuery(GameObject srcObj, GameObject targetObj, int aoeType, float range, float angleOrLength, SkillInstance instance, int senderId, int targetType, Vector3 relativeCenter, bool relativeToTarget, MyFunc<float, int, bool> callback)
 {
     float radian;
     Vector3 center;
     if (null != targetObj && relativeToTarget) {
         Vector3 srcPos = srcObj.transform.position;
         Vector3 targetPos = targetObj.transform.position;
         radian = Geometry.GetYRadian(new ScriptRuntime.Vector2(srcPos.x, srcPos.z), new ScriptRuntime.Vector2(targetPos.x, targetPos.z));
         ScriptRuntime.Vector2 newOffset = Geometry.GetRotate(new ScriptRuntime.Vector2(relativeCenter.x, relativeCenter.z), radian);
         center = targetPos + new Vector3(newOffset.X, relativeCenter.y, newOffset.Y);
     } else {
         radian = Geometry.DegreeToRadian(srcObj.transform.localRotation.eulerAngles.y);
         center = srcObj.transform.TransformPoint(relativeCenter);
     }
     if (aoeType == (int)SkillAoeType.Circle || aoeType == (int)SkillAoeType.Sector) {
         angleOrLength = Geometry.DegreeToRadian(angleOrLength);
         ClientModule.Instance.KdTree.Query(center.x, center.y, center.z, range, (float distSqr, KdTreeObject kdTreeObj) => {
             int targetId = kdTreeObj.Object.GetId();
             if (targetType == (int)SkillTargetType.Enemy && CharacterRelation.RELATION_ENEMY == EntityController.Instance.GetRelation(senderId, targetId) ||
                 targetType == (int)SkillTargetType.Friend && CharacterRelation.RELATION_FRIEND == EntityController.Instance.GetRelation(senderId, targetId)) {
                 bool isMatch = false;
                 if (aoeType == (int)SkillAoeType.Circle) {
                     isMatch = true;
                 } else {
                     ScriptRuntime.Vector2 u = Geometry.GetRotate(new ScriptRuntime.Vector2(0, 1), radian);
                     isMatch = Geometry.IsSectorDiskIntersect(new ScriptRuntime.Vector2(center.x, center.z), u, angleOrLength / 2, range, new ScriptRuntime.Vector2(kdTreeObj.Position.X, kdTreeObj.Position.Z), kdTreeObj.Radius);
                 }
                 if (isMatch) {
                     if (!callback(distSqr, kdTreeObj.Object.GetId())) {
                         return false;
                     }
                 }
             }
             return true;
         });
     } else {
         ScriptRuntime.Vector2 angleu = Geometry.GetRotate(new ScriptRuntime.Vector2(0, angleOrLength), radian);
         ScriptRuntime.Vector2 c = new ScriptRuntime.Vector2(center.x, center.z) + angleu / 2;
         GameFramework.ClientModule.Instance.KdTree.Query(c.X, 0, c.Y, range + angleOrLength / 2, (float distSqr, GameFramework.KdTreeObject kdTreeObj) => {
             int targetId = kdTreeObj.Object.GetId();
             if (targetType == (int)SkillTargetType.Enemy && CharacterRelation.RELATION_ENEMY == EntityController.Instance.GetRelation(senderId, targetId) ||
                 targetType == (int)SkillTargetType.Friend && CharacterRelation.RELATION_FRIEND == EntityController.Instance.GetRelation(senderId, targetId)) {
                 bool isMatch = false;
                 if (aoeType == (int)SkillAoeType.Capsule) {
                     isMatch = Geometry.IsCapsuleDiskIntersect(new ScriptRuntime.Vector2(center.x, center.z), angleu, range, new ScriptRuntime.Vector2(kdTreeObj.Position.X, kdTreeObj.Position.Z), kdTreeObj.Radius);
                 } else {
                     ScriptRuntime.Vector2 half = new ScriptRuntime.Vector2(range / 2, angleOrLength / 2);
                     isMatch = Geometry.IsObbDiskIntersect(c, half, radian, new ScriptRuntime.Vector2(kdTreeObj.Position.X, kdTreeObj.Position.Z), kdTreeObj.Radius);
                 }
                 if (isMatch) {
                     if (!callback(distSqr, kdTreeObj.Object.GetId())) {
                         return false;
                     }
                 }
             }
             return true;
         });
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:59,代码来源:TriggerUtil.cs

示例7: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance)
 {
     if (callData.GetParamNum() >= 3) {
         StartTime = long.Parse(callData.GetParamId(0));
         m_RemainTime = long.Parse(callData.GetParamId(1));
         m_RotateSpeed = DslUtility.CalcVector3(callData.GetParam(2) as Dsl.CallData);
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:8,代码来源:RotateTrigger.cs

示例8: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance)
 {
     int num = callData.GetParamNum();
     if (num > 0) {
         StartTime = long.Parse(callData.GetParamId(0));
     } else {
         StartTime = 0;
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:9,代码来源:DamageTrigger.cs

示例9: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance)
 {
     int num = callData.GetParamNum();
     if (num >= 1) {
         StartTime = long.Parse(callData.GetParamId(0));
     }
     if (num >= 2) {
         m_RemainTime = long.Parse(callData.GetParamId(1));
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:10,代码来源:GeneralTrigers.cs

示例10: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance)
 {
     int num = callData.GetParamNum();
     if (num >= 4) {
         StartTime = long.Parse(callData.GetParamId(0));
         m_RelativeOffset.X = float.Parse(callData.GetParamId(1));
         m_RelativeOffset.Y = float.Parse(callData.GetParamId(2));
         m_RelativeOffset.Z = float.Parse(callData.GetParamId(3));
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:10,代码来源:TransformTrigger.cs

示例11: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance )
 {
     int num = callData.GetParamNum();
     if (num >= 2) {
         StartTime = long.Parse(callData.GetParamId(0));
         m_Speed = float.Parse(callData.GetParamId(1));
     }
     if (num >= 3) {
         m_IsEffectSkillTime = bool.Parse(callData.GetParamId(2));
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:11,代码来源:AnimationTrigger.cs

示例12: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance)
 {
     if (callData.GetParamNum() > 0) {
         m_Type = callData.GetParamId(0);
     }
     if (callData.GetParamNum() > 1) {
         StartTime = long.Parse(callData.GetParamId(1));
     }
     if (callData.GetParamNum() > 2) {
         m_DeltaTime = long.Parse(callData.GetParamId(2));
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:12,代码来源:SectionTrigger.cs

示例13: 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) {
         if (curSectionTime >= StartTime) {
             int targetType = scene.EntityController.GetTargetType(senderObj.ActorId, senderObj.ConfigData, senderObj.Seq);
             int senderId = 0;
             if (senderObj.ConfigData.type == (int)SkillOrImpactType.Skill) {
                 senderId = senderObj.ActorId;
             } else {
                 senderId = senderObj.TargetActorId;
             }
             string effectPath = SkillParamUtility.RefixResourceVariable(m_EffectPath, instance, senderObj.ConfigData.resources);
             int emitImpact = m_EmitImpact;
             if (!m_IsExternalImpact) {
                 emitImpact = SkillInstance.GenInnerEmitSkillId(m_EmitImpact <= 0 ? 1 : m_EmitImpact);
             }
             int impactId = TriggerUtil.GetSkillImpactId(instance.Variables, senderObj.ConfigData);
             string emitBone = SkillParamUtility.RefixStringVariable(m_EmitBone, instance);
             float emitSpeed = m_EmitSpeed;
             int ct = 0;
             TriggerUtil.AoeQuery(senderObj, instance, senderId, targetType, m_RelativeCenter, m_RelativeToTarget, (float distSqr, int objId) => {
                 Dictionary<string, object> args;
                 TriggerUtil.CalcImpactConfig(emitImpact, impactId, instance, senderObj.ConfigData, out args);
                 Dictionary<string, object> addArgs = new Dictionary<string, object>() { { "emitEffect", effectPath }, { "emitSpeed", emitSpeed }, { "emitDir", m_Dir }, { "emitScale", m_Scale } };
                 foreach (var pair in addArgs) {
                     if (args.ContainsKey(pair.Key)) {
                         args[pair.Key] = pair.Value;
                     } else {
                         args.Add(pair.Key, pair.Value);
                     }
                 }
                 scene.EntityController.TrackImpact(senderObj.ConfigData, senderObj.Seq, senderObj.ActorId, senderId, objId, emitBone, emitImpact, m_Pos, args);
                 ++ct;
                 if (senderObj.ConfigData.maxAoeTargetCount <= 0 || ct < senderObj.ConfigData.maxAoeTargetCount) {
                     return true;
                 } else {
                     return false;
                 }
             });
             //GameFramework.LogSystem.Debug("AoeEmitEffectTriger:{0}", m_EffectPath);
             return false;
         } else {
             return true;
         }
     } else {
         return false;
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:52,代码来源:EffectTrigger.cs

示例14: Load

 protected override void Load(Dsl.CallData callData, SkillInstance instance)
 {
     int num = callData.GetParamNum();
     if (num >= 4) {
         StartTime = long.Parse(callData.GetParamId(0));
         m_RelativeOffset.x = float.Parse(callData.GetParamId(1));
         m_RelativeOffset.y = float.Parse(callData.GetParamId(2));
         m_RelativeOffset.z = float.Parse(callData.GetParamId(3));
     }
     if (num >= 5) {
         m_IsForRoundMove = callData.GetParamId(4) == "true";
     }
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:13,代码来源:TransformTrigger.cs

示例15: 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;
     }
     Vector3 pos = obj.GetMovementStateInfo().GetPosition3D();
     instance.CustomDatas.AddData<Vector3>(pos);
     return false;
 }
开发者ID:dreamanlan,项目名称:CSharpGameFramework,代码行数:13,代码来源:RestorePosTrigger.cs


注:本文中的SkillSystem.SkillInstance类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。