public virtual void Setup(float damage, float dazeMovementTime, float dazeActionTime, float force, ForceApplyMode forceApply, GameObject exclude) { this.damage = damage; this.dazeMovementTime = dazeMovementTime; this.dazeActionTime = dazeActionTime; this.force = force; forceApplyMode = forceApply; alreadyHit.Add(exclude.GetComponent <LiveEntity>()); }
public void Setup(float damage, float dazeMovementTime, float dazeActionTime, float force, ForceApplyMode forceApply, GameObject exclude, Vector3 origin, Vector3 direction, ItemInstance weaponInst, GameObject targetTransformGO) { base.Setup(damage, dazeMovementTime, dazeActionTime, force, forceApply, exclude, origin, direction); this.weaponInst = weaponInst; if (targetTransformGO == null) { GameObject tempGO = new GameObject("Target"); tempGO.transform.position = transform.position + direction * maxDistance; this.targetTransform = tempGO.transform; this.maxLifeSpan = maxDistance / speed; Destroy(tempGO, 12); } else { this.targetTransform = targetTransformGO.transform; this.maxLifeSpan = 10; //Randomize extremely, up life } worldVelocity = (worldVelocity.normalized + Random.onUnitSphere * randomisationAmount).normalized * speed; transform.position += .25f * worldVelocity.normalized; }
// Use this for initialization public void Setup(float damage, float dazeMovementTime, float dazeActionTime, float force, ForceApplyMode forceApply, GameObject exclude, Vector3 origin, Vector3 direction) { base.Setup(damage, dazeMovementTime, dazeActionTime, force, forceApply, exclude); transform.position = origin; //worldVelocity = direction.normalized * (maxDistance / maxLifeSpan); worldVelocity = direction.normalized * speed; elapsedLife = 0; }