예제 #1
0
 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); };
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
 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); };
 }
예제 #5
0
 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);
         }
     };
 }
예제 #6
0
        public virtual void UpdateEffects(SpellContext ctx)
        {
            if (!channeling)
            {
                return;
            }

            if (!activeCarrier)
            {
                activeCarrier = NewEffects(ctx);
            }

            activeCarrier.UpdateInstance(ctx);
        }
예제 #7
0
 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);
         }
     };
 }
예제 #8
0
        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);
        }
예제 #9
0
 public override void UpdateInstance(SpellContext spellCtx)
 {
     base.UpdateInstance(spellCtx);
     currCaster = spellCtx.caster;
 }
예제 #10
0
 public override void UpdateInstance(SpellContext spellCtx)
 {
     base.UpdateInstance(spellCtx);
     from = spellCtx.origin;
     to   = spellCtx.destination;
 }
예제 #11
0
 public virtual void UpdateInstance(SpellContext spellCtx)
 {
 }