From 3234aecee86acd61f9d0bf511335ea581f24f597 Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 20 Jul 2016 17:17:30 +0100 Subject: [PATCH] Removed cached portraits --- Assets/Fungus/Narrative/Scripts/Character.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Assets/Fungus/Narrative/Scripts/Character.cs b/Assets/Fungus/Narrative/Scripts/Character.cs index 917c6ab3..798dab7d 100644 --- a/Assets/Fungus/Narrative/Scripts/Character.cs +++ b/Assets/Fungus/Narrative/Scripts/Character.cs @@ -20,9 +20,8 @@ namespace Fungus public AudioClip soundEffect; public Sprite profileSprite; public List portraits; - public Sprite[] cachedPortraits; public FacingDirection portraitsFace; - public PortraitState state; + public PortraitState state = new PortraitState(); [Tooltip("Sets the active Say dialog with a reference to a Say Dialog object in the scene. All story text will now display using this Say Dialog.")] public SayDialog setSayDialog; @@ -39,12 +38,6 @@ namespace Fungus { activeCharacters.Add(this); } - - if (cachedPortraits == null) - { - cachedPortraits = new Sprite[portraits.Count]; - portraits.CopyTo(cachedPortraits); - } } protected virtual void OnDisable() @@ -85,11 +78,11 @@ namespace Fungus return null; } - for (int i = 0; i < cachedPortraits.Length; i++) + for (int i = 0; i < portraits.Count; i++) { - if ( String.Compare(cachedPortraits[i].name, portrait_string, true) == 0) + if ( String.Compare(portraits[i].name, portrait_string, true) == 0) { - return cachedPortraits[i]; + return portraits[i]; } } return null;