public virtual void Setup(SpellContext spellCtx) { ctxOnSetup = spellCtx; ignores = new List <Collider>(); ignores.AddRange(spellCtx.caster.transform.root.GetComponentsInChildren <Collider>()); onEffectiveObjects += colliders => { Debug.Log(colliders); }; }
public override void UpdateInstance(SpellContext spellCtx) { base.UpdateInstance(spellCtx); transform.position = spellCtx.origin; transform.forward = (spellCtx.destination - spellCtx.origin).ProjOnUp().normalized; fanMesh.angle = angle; fanMesh.radius = radius; }
public override void Setup(SpellContext spellCtx) { base.Setup(spellCtx); currHits = new RaycastHit[1000]; velocity = (spellCtx.destination - spellCtx.origin).ProjOnUp().normalized *initialSpeed; onBlockedObject += _ => { Debug.Log(_, _.collider); }; transform.position = spellCtx.origin; transform.forward = velocity; }
public override void Setup(SpellContext spellCtx) { base.Setup(spellCtx); currHits = new RaycastHit[1000]; ignores = new List <Collider>(); ignores.AddRange(spellCtx.caster.transform.root.GetComponentsInChildren <Collider>()); from = spellCtx.origin; to = spellCtx.destination; onBlockedObject += _ => { Debug.Log(_, _.collider); }; }
public override void Setup(SpellContext spellCtx) { base.Setup(spellCtx); currCaster = spellCtx.caster; ignores = null; onEffectiveObjects += colliders => { foreach (var c in colliders) { Debug.Log(c, c); } }; }
public virtual void UpdateEffects(SpellContext ctx) { if (!channeling) { return; } if (!activeCarrier) { activeCarrier = NewEffects(ctx); } activeCarrier.UpdateInstance(ctx); }
public override void Setup(SpellContext spellCtx) { base.Setup(spellCtx); currHits = new RaycastHit[1000]; ignores = new List <Collider>(); ignores.AddRange(spellCtx.caster.transform.root.GetComponentsInChildren <Collider>()); transform.position = spellCtx.origin; transform.forward = (spellCtx.destination - spellCtx.origin).ProjOnUp().normalized; fanMesh.angle = angle; fanMesh.radius = radius; onBlockedObjects += _ => { foreach (var hit in _) { Debug.DrawRay(hit.point, hit.normal, Color.yellow, 1f); } }; }
public virtual EffectCarrierBase NewEffects(SpellContext ctx) { var newCarrier = Instantiate(effectCarrierPrefab); newCarrier.maxLifeTime = effectCarrierMaxLifeTime; newCarrier.refreshLifeTimeOnUpdate = channel && refreshLifeTimeOnChannel; newCarrier.Setup(ctx); if (vfxPrefab) { Instantiate(vfxPrefab, newCarrier.transform); } if (channel) { newCarrier.onDestroy += _ => { StopChanneling(); }; } return(newCarrier); }
public override void UpdateInstance(SpellContext spellCtx) { base.UpdateInstance(spellCtx); currCaster = spellCtx.caster; }
public override void UpdateInstance(SpellContext spellCtx) { base.UpdateInstance(spellCtx); from = spellCtx.origin; to = spellCtx.destination; }
public virtual void UpdateInstance(SpellContext spellCtx) { }