protected override void OnExecute(InteractiveObj self, InteractiveObj target) { if (target.IsEnemy(self.Camp)) { target.Camp = self.Camp; SceneObjHeadInfo info = target.UIHeadInfo; if (info) { if (self.Camp == Common.MyselfCamp) { info.txtBlood.color = Color.green; info.sldBlood.fillRect.GetComponent <UnityEngine.UI.Graphic>().color = Color.green; DrawAttackRange draw = target.GetComponent <DrawAttackRange>(); if (draw) { draw.bNeedUpdate = false; } LineRenderer line = target.GetComponent <LineRenderer>(); if (line) { line.enabled = false; } } else { info.txtBlood.color = Color.red; info.sldBlood.fillRect.GetComponent <UnityEngine.UI.Graphic>().color = Color.red; } } self.DoDamage(new Damage(WorldSetting.Effect.Dark, 5), WorldInteractObj.Instance); } }
private void OnCollisionEnter(Collision collision) { if (Master.bCanUseJumpSkill) { InteractiveObj target = collision.collider.GetComponent <InteractiveObj>(); if (target && target.IsAlive && target.IsEnemy(Master.Camp)) { Vector3 myCenter = Master.ColliderSelf.bounds.center; Vector3 center = target.ColliderSelf.bounds.center; float top = target.ColliderSelf.bounds.max.y; if (top - Master.ColliderSelf.bounds.min.y < 0.1f) { float y = center.y; center.y = myCenter.y; myCenter.y = y; if (Master.ColliderSelf.bounds.Contains(center) || target.ColliderSelf.bounds.Contains(myCenter)) { target.DoDamage(new Damage(WorldSetting.Effect.Physical, 1000000), Master); Master.Body.RigidSelf.AddForce(0, 500, 0, ForceMode.Impulse); return; } } } } OnTrigger(collision.collider); }
protected override void OnExecute(InteractiveObj self, Vector3 pos) { RaycastHit[] hits = Physics.SphereCastAll(pos, Range, Vector3.up, float.MaxValue, layerEnemey); for (int i = 0, length = hits.Length; i < length; ++i) { InteractiveObj target = hits[i].collider.GetComponent <InteractiveObj>(); if (target && self.IsEnemy(target.Camp)) { target.DoDamage(new Damage(EffectType, self.CalAtkDamage(EffectBaseValue)), self); } } }
protected override void OnExecute(InteractiveObj self, InteractiveObj target) { target.DoDamage(new Damage(EffectType, self.CalAtkDamage(EffectBaseValue)), self); EffectPlayer.PlayOnTransform(EffectFX, target.BeAtkPoint); AudioSystem.Instance.PlayOnTransform(EffectSE, target.BeAtkPoint); Debuff_Dot dot = new Debuff_Dot(); dot.Init(nBuffOrder, nDuration, BuffBase.Type.Debuff, self, target); dot.InitDot(nFirstEffectTime, nDuration, EffectType, self.CalAtkDamage(nEffectDamage), self.CalAtkDamage(nEndDamage)); dot.InitDotResources(objContinueFX, acContinueSE, objContinueEffectFX, acContinueEffectSE, objEndEffectFX, acEndEffectSE); target.AddBuff(dot); }
protected virtual void OnExecute(InteractiveObj self, InteractiveObj target) { target.DoDamage(new Damage(EffectType, self.CalAtkDamage(EffectBaseValue)), self); }