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); } } } }
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); } } }
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; } }
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; } }