public void ShowIn(IContestDisplay display) { effects = display.GetCharacter().GetComponent <ContestEffects>(); ContestEffects.Action action = effects.Get(effectName); switch (action.mode) { case ContestEffects.Action.Mode.PlayAnimation: case ContestEffects.Action.Mode.PlayAnimationUntilEnd: var anim = effects.GetComponent <Animation>(); if (action.parameter != "") { anim.clip = anim.GetClip(action.parameter); } anim.Play(); break; case ContestEffects.Action.Mode.StopAnimation: effects.GetComponent <Animation>().Stop(); break; case ContestEffects.Action.Mode.PlaySound: var audio = effects.GetComponent <AudioSource>(); if (action.parameter != "") { audio.clip = effects.GetSound(action.parameter); } audio.Play(); break; case ContestEffects.Action.Mode.StopSound: effects.GetComponent <AudioSource>().Stop(); break; case ContestEffects.Action.Mode.PlayParticules: effects.GetComponent <ParticleSystem>().Play(); break; case ContestEffects.Action.Mode.StopParticules: effects.GetComponent <ParticleSystem>().Stop(); break; case ContestEffects.Action.Mode.ChangeSprite: effects.GetComponent <SpriteRenderer>().sprite = effects.GetSprite(action.parameter); break; } if (action.autoGoNext) { display.MoveNext(); } }
public void ShowIn(IContestDisplay display) { display.HideButtons(); display.MoveNext(); }