/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> public override void Awake() { // 刚体 add by TangJian 2018/01/16 16:15:37 base.Awake(); // 动画 add by TangJian 2018/01/15 15:04:59 skeletonAnimation = GetComponentInChildren <SkeletonAnimator>(); // 伤害 add by TangJian 2018/01/15 15:05:04 { damageController = GetComponentInChildren <DamageController>(); var damageData = damageController.damageData; damageData.itriggerDelegate = this; damageData.force = Vector3.zero; } }
void Start() { currentAngle = Vector3.zero; damageController = GetComponentInChildren <DamageController>(); var damageData = damageController.damageData; damageData.itriggerDelegate = this; damageData.DamageDirectionType = DamageDirectionType.Directional; //朝向的伤害 damageData.atk = 1; // damageData.direction = new Vector3(1, 0, 0); damageData.force = new Vector3(5, 0, 0); damageData.hitType = 2; Destroy(gameObject, 5); }
// 设置力度值 public static DamageController SetForceValue(this DamageController target, float value) { target.damageData.forceValue = value; return(target); }
public static DamageController SetEffectOrientation(this DamageController target, Vector3 value) { target.damageData.effectOrientation = value; return(target); }
public static DamageController SetForcedOffset(this DamageController target, Vector3 value) { target.damageData.forcedOffset = value; return(target); }
public static DamageController SetIgnoreShiled(this DamageController target, bool ignoreShield) { target.damageData.ignoreShield = ignoreShield; return(target); }
public static bool IsCritical(this DamageController target) { return(target.damageData.isCritical); }
public static DamageController SetDamageMass(this DamageController target, float value) { target.damageData.DamageMass = value; return(target); }
public static DamageController SetId(this DamageController target, string id) { target.id = id; return(target); }
public static DamageController SetTriggerDelegate(this DamageController target, ITriggerDelegate itriggerDelegate) { target.damageData.itriggerDelegate = itriggerDelegate; return(target); }
public static DamageController SetOwner(this DamageController target, GameObject owner) { target.damageData.owner = owner; return(target); }
public static DamageController SetRecordType(this DamageController target, RecordType recordType) { target.damageData.recordType = recordType; return(target); }
public static DamageController SetDamageId(this DamageController target, string teamId) { target.damageData.DamageId = teamId; return(target); }
public static DamageController SetDestroyTime(this DamageController target, float time) { GameObject.Destroy(target.gameObject, time); return(target); }
public void AddCurrAnimDamageGameObject(DamageController damageController) { currAnimDamageControllerList.Add(damageController); }
public static DamageController SetMagical(this DamageController target, float magical) { target.damageData.magical = magical; return(target); }
public static DamageController SetPoiseCut(this DamageController target, float value) { target.damageData.poiseCut = value; return(target); }
public static DamageController SetHitType(this DamageController target, HitType hitType) { target.damageData.hitType = (int)hitType; return(target); }
public static DamageController SetCritical(this DamageController target, bool isCritical) { target.damageData.isCritical = isCritical; return(target); }
public static DamageController SetDirection(this DamageController target, Vector3 direction) { target.damageData.direction = direction; return(target); }
public static DamageController SetBreakShiled(this DamageController target, bool breakShield) { target.damageData.breakShield = breakShield; return(target); }
public static DamageController SetMoveBy(this DamageController target, Vector3 moveBy) { target.damageData.targetMoveBy = moveBy; return(target); }
public static DamageController SetUseForcedOffset(this DamageController target, bool value) { target.damageData.useForcedOffset = value; return(target); }
public static DamageController setDamageDirectionType(this DamageController target, DamageDirectionType damageDirectionType) { target.damageData.DamageDirectionType = damageDirectionType; return(target); }
public static DamageController SetForcedOffsetDuration(this DamageController target, float value) { target.damageData.forcedOffsetDuration = value; return(target); }
public static DamageController SetDamageEffectType(this DamageController target, DamageEffectType damageEffectType) { target.damageData.damageEffectType = damageEffectType; return(target); }
// 设置顿帧 public static DamageController SetSelfSuspend(this DamageController target, float selfSuspendTime, float selfSuspendScale) { target.damageData.selfSuspendTime = selfSuspendTime; target.damageData.selfSuspendScale = selfSuspendScale; return(target); }
public static DamageController SetAtkPropertyType(this DamageController target, AtkPropertyType atkPropertyType) { target.damageData.atkPropertyType = atkPropertyType; return(target); }
public void Add(DamageController damageController) { damageControllers.Add(damageController); }
public static DamageController SetAtk(this DamageController target, float atk) { target.damageData.atk = atk; return(target); }