コード例 #1
0
 public override void Update(LevelDefinition levelDefinition)
 {
     if (!Player.local)
     {
         return;
     }
     else
     {
         if (!Player.local.body)
         {
             leftIceWind  = null;
             rightIceWind = null;
             return;
         }
         else
         {
             if (!Player.local.body.handLeft)
             {
                 return;
             }
             else
             {
                 GetIceWindSpell(Player.local.body.handLeft);
                 GetIceWindSpell(Player.local.body.handRight);
             }
         }
     }
 }
コード例 #2
0
        public void AddParticlesToCreature(ParticleSystem ps)
        {
            frozenVFXs = new List <ParticleSystem>();

            foreach (Collider col in creature.gameObject.GetComponentsInChildren <Collider>())
            {
                ParticleSystem _ps = IceWindController.AddParticlesToCollider(col, ps);

                if (_ps)
                {
                    frozenVFXs.Add(_ps);
                }
            }
        }
コード例 #3
0
        public void OnFrozenCollision(ref CollisionStruct collisionStruct)
        {
            if (!active)
            {
                return;
            }

            switch (GetTargetType(collisionStruct))
            {
            case TargetType.Avatar:
                return;

            case TargetType.Environment:
                return;

            case TargetType.NPC:
                IceWindController.TryFreezeCreature(collisionStruct.targetCollider.GetComponentInParent <Creature>(), false, 0.1f, freezeVFX, addParticles);
                break;
            }
        }
コード例 #4
0
        public void GetIceWindSpell(BodyHand hand)
        {
            if (!hand.caster)
            {
                return;
            }

            if (!hand.caster.currentSpell)
            {
                return;
            }



            switch (hand.side)
            {
            case Side.Left:
                if (leftIceWind)
                {
                    if (hand.caster.currentSpell != iceWindSpellL)
                    {
                        leftIceWind.active = false;
                        leftIceWind.frostVFX.Stop();
                    }
                    return;
                }
                else
                {
                    if (hand.caster.currentSpell.name == "IceSpell(Clone)")
                    {
                        iceWindSpellL      = hand.caster.currentSpell;
                        leftIceWind        = hand.caster.currentSpell.gameObject.AddComponent <IceWindController>();
                        leftIceWind.hand   = hand;
                        leftIceWind.active = true;
                        leftIceWind.frostVFX.Play();
                    }
                }
                return;

            case Side.Right:
                if (rightIceWind)
                {
                    if (hand.caster.currentSpell != iceWindSpellR)
                    {
                        rightIceWind.active = false;
                        rightIceWind.frostVFX.Stop();
                    }
                    return;
                }
                else
                {
                    if (hand.caster.currentSpell.name == "IceSpell(Clone)")
                    {
                        iceWindSpellR       = hand.caster.currentSpell;
                        rightIceWind        = hand.caster.currentSpell.gameObject.AddComponent <IceWindController>();
                        rightIceWind.hand   = hand;
                        rightIceWind.active = true;
                        rightIceWind.frostVFX.Play();
                    }
                }
                return;

            default:
                return;
            }
        }