public CardSkill(SkillExecutionTime executionTime, List <SkillTarget> targets, Action <CardModel> effect, SkillVisualEffect visualEffect) { #if UNITY_EDITOR || DEVELOPMENT_BUILD if (targets == null) { throw new ArgumentNullException("targets", "Targets parameter cannot be null."); } else if (targets.Count == 0) { throw new ArgumentException("Targets parameter cannot be empty.", "targets"); } if (effect == null) { throw new ArgumentNullException("effect", "Effect parameter cannot be null."); } if (executionTime == SkillExecutionTime.OnDeployManual && targets.Count > 1) { throw new ArgumentException( "In this version of the game skill marked as OnDeployManual can only have one target type. Sorry.", "targets"); } #endif ExecutionTime = executionTime; Targets = targets; Effect = effect; VisualEffect = visualEffect; }
/// <summary> /// Schedules VFXs. /// Number is equal to given list size and the position match corresponding card position. /// Effects remain inactive until played. /// All effects are of the same given type. /// </summary> public void ScheduleParticleEffect(List <CardUI> cards, SkillVisualEffect visualEffect) { foreach (CardUI card in cards) { InstanciateEffect(card.transform, visualEffect); } }
void InstanciateEffect(Transform position, SkillVisualEffect effect) { var instance = Instantiate(_effects[(int)effect], position); instance.SetActive(false); _instanciatedEffects.Add(instance); // for now there is only cloud to chose from ParticleEffect vfx = instance.GetComponent <ParticleEffect>(); vfx.PlayAllEffects(); }
internal void BroadcastPlayVFX_StatusUpdate(List <SkillTargetData> targets, SkillVisualEffect visualEffect) { if (GameLogicStatusChangedEventHandler == null) { ReturnControl(); // interface not attached - immediately return control } else { GameLogicStatusChangedEventHandler.Invoke( this, new GameLogicStatusChangedEventArgs(GameLogicMessageType.PlaySkillVFX, CurrentPlayer) { Targets = targets, VisualEffect = visualEffect, TopTotalStrength = TopTotalStrength, BotTotalStrength = BotTotalStrength }); } }