Exemplo n.º 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); };
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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); };
 }
Exemplo n.º 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);
         }
     };
 }
Exemplo n.º 6
0
        public virtual void UpdateEffects(SpellContext ctx)
        {
            if (!channeling)
            {
                return;
            }

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

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