Search Results for

    Show / Hide Table of Contents

    Class Projectile

    Inheritance
    object
    UnityEngine.Object
    UnityEngine.Component
    UnityEngine.Behaviour
    UnityEngine.MonoBehaviour
    Mirror.NetworkBehaviour
    DewNetworkBehaviour
    Actor
    AbilityInstance
    Projectile
    StandardProjectile
    Implements
    ILogicUpdate
    ICleanup
    ICustomDestroyRoutine
    Inherited Members
    AbilityInstance.useBudgetSystem
    AbilityInstance.maxBudget
    AbilityInstance.currentCostSum
    AbilityInstance.currentCostSumPerPlayer
    AbilityInstance.ResetBudget()
    AbilityInstance.budgetPressure
    AbilityInstance.Budget_ShouldPlayEffects()
    AbilityInstance.Budget_ShouldDoFullCalculations()
    AbilityInstance.info
    AbilityInstance.skillLevel
    AbilityInstance.startEffectNoStop
    AbilityInstance.startEffect
    AbilityInstance.endEffect
    AbilityInstance.budgetCost
    AbilityInstance.chain
    AbilityInstance.gem
    AbilityInstance.tvDefaultHarmfulEffectTargets
    AbilityInstance.tvDefaultUsefulEffectTargets
    AbilityInstance.tvDefaultAllExceptSelf
    AbilityInstance.hasOngoingSequences
    AbilityInstance.OnStart()
    AbilityInstance.DestroyOnCondition(Func<bool>)
    AbilityInstance.DestroyOnDeath(Entity, bool)
    AbilityInstance.DestroyOnDestroy(Actor)
    AbilityInstance.StartSequence(IEnumerator)
    AbilityInstance.OnCreateSequenced()
    AbilityInstance.CreateStatusEffect<T>(T, Entity, Action<T>)
    AbilityInstance.CreateStatusEffect<T>(Entity, Action<T>)
    AbilityInstance.GetActorReadableName()
    AbilityInstance.StartChargingChannel(ChargingChannel)
    AbilityInstance.effectiveLevel
    AbilityInstance.statEntity
    AbilityInstance.DefaultDamage(ScalingValue, float)
    AbilityInstance.PhysicalDamage(ScalingValue, float)
    AbilityInstance.MagicDamage(ScalingValue, float)
    AbilityInstance.PhysicalMagicDamage(ScalingValue, float)
    AbilityInstance.PureDamage(ScalingValue, float)
    AbilityInstance.Damage(ScalingValue, float)
    AbilityInstance.CreateDamage(DamageData.SourceType, ScalingValue, float)
    AbilityInstance.Heal(ScalingValue)
    AbilityInstance.GetValue(ScalingValue)
    AbilityInstance.GetValue<T>(T[])
    AbilityInstance.GetValue(StarScalingValue)
    AbilityInstance.GetValueInt(StarScalingValue)
    Actor.TrackKills(float, Action<EventInfoKill>)
    Actor.CustomRpc_RegisterClientMessageHandler<T>(Action<T>)
    Actor.CustomRpc_ClearClientMessageHandlers()
    Actor.CustomRpc_UnregisterClientMessageHandler<T>()
    Actor.CustomRpc_UnregisterClientMessageHandler<T>(Action<T>)
    Actor.CustomRpc_RegisterServerMessageHandler<T>(Action<T>)
    Actor.CustomRpc_RegisterServerMessageHandler<T>(string, Action<T, DewPlayer>)
    Actor.CustomRpc_ClearServerMessageHandlers()
    Actor.CustomRpc_UnregisterServerMessageHandler<T>()
    Actor.CustomRpc_UnregisterServerMessageHandler<T>(Action<T>)
    Actor.CustomRpc_UnregisterServerMessageHandler<T>(Action<T, DewPlayer>)
    Actor.CustomRpc_SendMessageToServer<T>(T)
    Actor.CustomRpc_SendMessageToClient<T>(DewPlayer, T)
    Actor.CustomRpc_SendMessageToAllClients<T>(T)
    Actor.ActorEvent_OnAbilityInstanceCreated
    Actor.ActorEvent_OnAbilityInstanceBeforePrepare
    Actor.ActorEvent_OnDealDamage
    Actor.ActorEvent_OnDoHeal
    Actor.ActorEvent_OnDoManaHeal
    Actor.ActorEvent_OnSpendMana
    Actor.ActorEvent_OnKill
    Actor.ActorEvent_OnAttackHit
    Actor.ActorEvent_OnAttackEffectTriggered
    Actor.ActorEvent_OnSpawnSummon
    Actor.ActorEvent_OnApplyElemental
    Actor.ActorEvent_OnGiveShield
    Actor.ClientActorEvent_OnDestroyed
    Actor.ClientActorEvent_OnCreate
    Actor.DoHeal(HealData, Entity, ReactionChain)
    Actor.DoManaHeal(HealData, Entity, ReactionChain)
    Actor.DefaultDamage(float, float)
    Actor.PhysicalDamage(float, float)
    Actor.MagicDamage(float, float)
    Actor.PureDamage(float, float)
    Actor.CreateDamage(DamageData.SourceType, float, float)
    Actor.Heal(float)
    Actor.DealDamage(DamageData, Entity, ReactionChain)
    Actor.DoBasicAttackHit(Entity, bool, bool, float, float)
    Actor.TriggerAttackEffects(Entity, float, AttackEffectType, ReactionChain)
    Actor.RefundMana(float, Entity)
    Actor.SpendMana(float, Entity)
    Actor.CreateAbilityInstance<T>(T, Vector3, Quaternion?, CastInfo, Action<T>)
    Actor.CreateAbilityInstance<T>(Vector3, Quaternion?, CastInfo, Action<T>)
    Actor.CreateAbilityInstance(Type, Vector3, Quaternion?, CastInfo, Action<AbilityInstance>)
    Actor.CreateStatusEffect<T>(T, Entity, CastInfo, Action<T>)
    Actor.CreateStatusEffect<T>(Entity, CastInfo, Action<T>)
    Actor.CreateStatusEffect(Type, Entity, CastInfo, Action<StatusEffect>)
    Actor.GiveShield(Entity, float, float, bool, ReactionChain)
    Actor.CreateActor<T>(Vector3, Quaternion?, Action<T>)
    Actor.CreateActor<T>(T, Vector3, Quaternion?, Action<T>)
    Actor.SpawnEntity<T>(Vector3, Quaternion?, DewPlayer, int, Action<T>)
    Actor.SpawnEntity<T>(T, Vector3, Quaternion?, DewPlayer, int, Action<T>)
    Actor.Teleport(Entity, Vector3)
    Actor.ShowOnScreenTimerLocally(OnScreenTimerHandle)
    Actor.HideOnScreenTimerLocally(OnScreenTimerHandle)
    Actor.ApplyElemental(ElementalType, Entity, int)
    Actor.KilledByUnstoppableEffects
    Actor.ScaleDurationByTenacityEffects
    Actor.CreateBasicEffect(Entity, BasicEffect, float, string, DuplicateEffectBehavior)
    Actor.SpawnSummon<T>(Vector3, Quaternion?, Action<T>)
    Actor.ApplyCooldownReduction(AbilityTrigger, float, bool, bool)
    Actor.ApplyCooldownReductionByRatio(AbilityTrigger, float, bool)
    Actor.ResetCooldown(AbilityTrigger, bool)
    Actor.ApplyCooldownReductionByRatio(AbilityTrigger, CooldownReductionByRatioSettings)
    Actor.ApplyCooldownReduction(AbilityTrigger, CooldownReductionSettings)
    Actor.dealtDamageProcessor
    Actor.dealtHealProcessor
    Actor.dealtManaHealProcessor
    Actor.dealtShieldProcessor
    Actor.dealtCooldownReductionProcessor
    Actor.dealtCooldownReductionByRatioProcessor
    Actor.spawnedChildVarDefProcessor
    Actor.ProcessShieldAmount(float, Entity)
    Actor.ProcessSpawnedChildVarDefProcessor(ref VariantDef, Type)
    Actor.persistentData
    Actor.persistentSyncedData
    Actor.ClientEvent_OnPersistentSyncedDataChanged
    Actor.OnCreate_ActorData()
    Actor.HasData<T>()
    Actor.RemoveData<T>()
    Actor.RemoveData(object)
    Actor.AddData<T>(T)
    Actor.TryGetData<T>(out T)
    Actor.GetData<T>()
    Actor.FindData<T>(Predicate<T>)
    Actor.TryFindData<T>(Predicate<T>, out T)
    Actor.isDestroyedOnRoomChange
    Actor.isNewInstance
    Actor.creationTime
    Actor.persistentNetId
    Actor.isDestroyLocked
    Actor.parentActor
    Actor.position
    Actor.rotation
    Actor.chainTempName
    Actor.children
    Actor.childrenInNetwork
    Actor.Awake()
    Actor.OnStartClient()
    Actor.ActiveFrameUpdate()
    Actor.ActiveLogicUpdate(float)
    Actor.ToString()
    Actor.CustomDestroyRoutine()
    Actor.ICleanup.canDestroy
    Actor.ICleanup.OnCleanup()
    Actor.isActive
    Actor.isDestroyed
    Actor.OnStopServer()
    Actor.OnStopClient()
    Actor.OnEnable()
    Actor.ShouldBeSavedWithRoom()
    Actor.ICustomDestroyRoutine.CustomDestroyRoutine()
    Actor.GetNetworkAuthorityConnection()
    Actor.GetOriginalName()
    Actor.parentActorNetId
    Actor.ancestors
    Actor.firstEntity
    Actor.firstTrigger
    Actor.IsDescendantOf(Actor)
    Actor.IsDescendantOf<T>()
    Actor.FindFirstAncestorOfType<T>()
    Actor.FindFirstOfType<T>()
    Actor.Destroy()
    Actor.DestroyIfActive()
    Actor.LockDestroy()
    Actor.UnlockDestroy()
    Actor.IsExcludedFromRoomSave()
    Actor.ExcludeFromRoomSave()
    Actor.ClearExcludeFromRoomSave()
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject, Entity)
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNewNetworked(GameObject)
    DewNetworkBehaviour.FxPlayNetworked(GameObject)
    DewNetworkBehaviour.FxPlayNetworked(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNetworked(GameObject, Entity)
    DewNetworkBehaviour.FxPlayNetworked(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxStopNetworked(GameObject)
    DewNetworkBehaviour.FxPlayNew(GameObject)
    DewNetworkBehaviour.FxPlayNew(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlayNew(GameObject, Entity)
    DewNetworkBehaviour.FxPlayNew(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlay(GameObject)
    DewNetworkBehaviour.FxPlay(GameObject, Vector3, Quaternion?)
    DewNetworkBehaviour.FxPlay(GameObject, Entity)
    DewNetworkBehaviour.FxPlay(GameObject, Entity, Vector3, Quaternion?)
    DewNetworkBehaviour.FxStop(GameObject)
    DewNetworkBehaviour.FxApplySpeedMultiplier(GameObject, float)
    DewNetworkBehaviour.FxApplySpeedMultiplierNetworked(GameObject, float)
    DewNetworkBehaviour.InvalidateInstance()
    DewNetworkBehaviour.OnLateStart()
    DewNetworkBehaviour.OnLateStartServer()
    DewNetworkBehaviour.OnStop()
    DewNetworkBehaviour.OnDestroy()
    DewNetworkBehaviour.GetComponent<T>(out T)
    Namespace: Global
    Assembly: Dew.Core.dll
    Syntax
    public abstract class Projectile : AbilityInstance, ILogicUpdate, ICleanup, ICustomDestroyRoutine

    Fields

    _estimatedVelocity

    Declaration
    protected Vector3 _estimatedVelocity
    Field Value
    Type Description
    UnityEngine.Vector3

    canCollideMidFlight

    Declaration
    [BoxGroup("Projectile Settings", true, false, 0)]
    [LabelText("Can Collide With Entity Mid-Flight")]
    [ToggleLeft]
    public bool canCollideMidFlight
    Field Value
    Type Description
    bool

    collisionRadius

    Declaration
    [Title("Collisions", null, TitleAlignments.Left, true, true)]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public float collisionRadius
    Field Value
    Type Description
    float

    collisionTargets

    Declaration
    [ShowIf("canCollideMidFlight", true)]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public AbilityTargetValidator collisionTargets
    Field Value
    Type Description
    AbilityTargetValidator

    customEndHeight

    Declaration
    [ShowIf("@mode != Projectile.ProjectileMode.Target && !endsWithSameHeight", true)]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public float customEndHeight
    Field Value
    Type Description
    float

    destroyOnComplete

    Declaration
    [FormerlySerializedAs("killOnComplete")]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public bool destroyOnComplete
    Field Value
    Type Description
    bool

    dissipateOnTerrain

    Declaration
    [BoxGroup("Projectile Settings", true, false, 0)]
    [ToggleLeft]
    public bool dissipateOnTerrain
    Field Value
    Type Description
    bool

    effectOnComplete

    Declaration
    [BoxGroup("Projectile Settings", true, false, 0)]
    [LabelText("Complete")]
    public GameObject effectOnComplete
    Field Value
    Type Description
    UnityEngine.GameObject

    effectOnDissipate

    Declaration
    [BoxGroup("Projectile Settings", true, false, 0)]
    [LabelText("Dissipate")]
    public GameObject effectOnDissipate
    Field Value
    Type Description
    UnityEngine.GameObject

    effectOnEntity

    Declaration
    [BoxGroup("Projectile Settings", true, false, 0)]
    [LabelText("Entity")]
    public GameObject effectOnEntity
    Field Value
    Type Description
    UnityEngine.GameObject

    effectOnFly

    Declaration
    [Title("Effects", null, TitleAlignments.Left, true, true)]
    [BoxGroup("Projectile Settings", true, false, 0)]
    [LabelText("Fly")]
    public GameObject effectOnFly
    Field Value
    Type Description
    UnityEngine.GameObject

    endDistance

    Declaration
    [ShowIf("@mode == Projectile.ProjectileMode.Direction", true)]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public float endDistance
    Field Value
    Type Description
    float

    endsWithSameHeight

    Declaration
    [ShowIf("@mode != Projectile.ProjectileMode.Target", true)]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public bool endsWithSameHeight
    Field Value
    Type Description
    bool

    horizontalOffsetOverTrajectory

    Declaration
    [LabelText("Horizontal Offset")]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public AnimationCurve horizontalOffsetOverTrajectory
    Field Value
    Type Description
    UnityEngine.AnimationCurve

    killOnDissipate

    Declaration
    [BoxGroup("Projectile Settings", true, false, 0)]
    public bool killOnDissipate
    Field Value
    Type Description
    bool

    mode

    Declaration
    [Title("Flight", null, TitleAlignments.Left, true, true)]
    [EnumToggleButtons]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public Projectile.ProjectileMode mode
    Field Value
    Type Description
    Projectile.ProjectileMode

    onEntity

    Declaration
    public SafeAction<Projectile.EntityHit> onEntity
    Field Value
    Type Description
    SafeAction<Projectile.EntityHit>

    rotationType

    Declaration
    [LabelText("Rotation")]
    [EnumToggleButtons]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public Projectile.RotationType rotationType
    Field Value
    Type Description
    Projectile.RotationType

    scaleHorizontalOffsetOnLength

    Declaration
    [LabelText("Scale On Trajectory Length")]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public bool scaleHorizontalOffsetOnLength
    Field Value
    Type Description
    bool

    scaleVerticalOffsetOnLength

    Declaration
    [LabelText("Scale On Trajectory Length")]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public bool scaleVerticalOffsetOnLength
    Field Value
    Type Description
    bool

    start

    Declaration
    [EnumToggleButtons]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public Projectile.StartPositionType start
    Field Value
    Type Description
    Projectile.StartPositionType

    startInFrontDistance

    Declaration
    [LabelText("Front Distance")]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public float startInFrontDistance
    Field Value
    Type Description
    float

    verticalOffsetOverTrajectory

    Declaration
    [LabelText("Vertical Offset")]
    [BoxGroup("Projectile Settings", true, false, 0)]
    public AnimationCurve verticalOffsetOverTrajectory
    Field Value
    Type Description
    UnityEngine.AnimationCurve

    Properties

    isCompleted

    Did this projectile complete its course?

    Declaration
    public bool isCompleted { get; }
    Property Value
    Type Description
    bool

    isFlying

    Is this projectile still flying over its course?

    Declaration
    public bool isFlying { get; }
    Property Value
    Type Description
    bool

    targetEntity

    Declaration
    protected Entity targetEntity { get; }
    Property Value
    Type Description
    Entity

    targetPosition

    It is recommended to edit this only in OnPrepare.

    Declaration
    protected Vector3 targetPosition { get; set; }
    Property Value
    Type Description
    UnityEngine.Vector3

    Methods

    AddEffect(AddEffectTarget, GameObject)

    Locally add an effect.

    Given effect will be instantiated and set/added to this projectile.

    Declaration
    public void AddEffect(Projectile.AddEffectTarget target, GameObject eff)
    Parameters
    Type Name Description
    Projectile.AddEffectTarget target
    UnityEngine.GameObject eff

    CalculateOffsetOverTrajectoryInWorldSpace(float, Quaternion)

    Declaration
    protected Vector3 CalculateOffsetOverTrajectoryInWorldSpace(float normalizedPosition, Quaternion rotation)
    Parameters
    Type Name Description
    float normalizedPosition
    UnityEngine.Quaternion rotation
    Returns
    Type Description
    UnityEngine.Vector3

    CheckForCompletion()

    Declaration
    protected virtual bool CheckForCompletion()
    Returns
    Type Description
    bool

    Dissipate()

    Dissipate this projectile.

    Declaration
    public void Dissipate()

    FrameUpdate()

    Declaration
    public override void FrameUpdate()
    Overrides
    Actor.FrameUpdate()

    GetTargetWorldPosition()

    Declaration
    protected virtual Vector3 GetTargetWorldPosition()
    Returns
    Type Description
    UnityEngine.Vector3

    LogicUpdate(float)

    Declaration
    public override void LogicUpdate(float dt)
    Parameters
    Type Name Description
    float dt
    Overrides
    AbilityInstance.LogicUpdate(float)

    OnComplete()

    Called on server when this Projectile fully completes its path without being despawned by itself/dissipated.

    Default behaviour instantiates a new effectOnComplete effect using the position and rotation of this projectile on every clients, and stops effectOnFly effect.

    It will also kill this projectile if killOnComplete is set.

    Note: On targeted projectiles, normally OnEntity will be fired before OnComplete. It might fire differently if for example the projectile is detached or the target became an invalid target.

    Declaration
    protected virtual void OnComplete()

    OnCreate()

    Declaration
    protected override void OnCreate()
    Overrides
    AbilityInstance.OnCreate()

    OnDestroyActor()

    Declaration
    protected override void OnDestroyActor()
    Overrides
    AbilityInstance.OnDestroyActor()

    OnDisable()

    Declaration
    protected override void OnDisable()
    Overrides
    Actor.OnDisable()

    OnDissipate()

    Called on server when this Projectile is dissipated by an outer source. e.g. Projectile Absorbing Wall

    Default behaviour instantiates a new effectOnDissipate effect using the position and rotation of this projectile on every clients

    Declaration
    protected virtual void OnDissipate()

    OnEntity(EntityHit)

    Called on server when this Projectile in server detects a collision with an Entity.

    Default behaviour instantiates a new effectOnEntity effect at the hit point with the rotation of this projectile attached to the entity on every clients.

    Declaration
    protected virtual void OnEntity(Projectile.EntityHit hit)
    Parameters
    Type Name Description
    Projectile.EntityHit hit

    OnPrepare()

    Declaration
    protected override void OnPrepare()
    Overrides
    AbilityInstance.OnPrepare()

    OnStartServer()

    Declaration
    public override void OnStartServer()
    Overrides
    Actor.OnStartServer()

    PositionSolver(float)

    Declaration
    protected abstract Vector3 PositionSolver(float dt)
    Parameters
    Type Name Description
    float dt
    Returns
    Type Description
    UnityEngine.Vector3

    RotationSolver(float)

    Declaration
    protected virtual Quaternion RotationSolver(float dt)
    Parameters
    Type Name Description
    float dt
    Returns
    Type Description
    UnityEngine.Quaternion

    SetCustomStartPosition(Vector3)

    Set custom start position for projectiles with 'Custom' start position mode. Call this in OnPrepare.

    Declaration
    public void SetCustomStartPosition(Vector3 pos)
    Parameters
    Type Name Description
    UnityEngine.Vector3 pos
    Exceptions
    Type Condition
    System.InvalidOperationException

    StopFlying()

    Stop this projectile and its effectOnFly effect. This will also make this projectile instantly stop checking collisions. Note that this does not call OnComplete nor OnDissipate.

    Declaration
    protected void StopFlying()

    Implements

    ILogicUpdate
    ICleanup
    ICustomDestroyRoutine

    Extension Methods

    ActorCheck.IsNullOrInactive(Actor)
    DewGUI.SetExpandHeight<T>(T, bool)
    DewGUI.SetExpandHeight<T>(T, float)
    DewGUI.SetExpandWidth<T>(T, bool)
    DewGUI.SetExpandWidth<T>(T, float)
    DewGUI.SetHeight<T>(T, float)
    DewGUI.SetText<T>(T, string)
    DewGUI.SetTextLocalized<T>(T, string)
    DewGUI.SetWidth<T>(T, float)
    In This Article
    Back to top Shape of Dreams API Documentation