DialogueSystemUISkin ActivateSkin(DialogueBehaviour behaviour, string skinName)
        {
            if (_activeSkins.ContainsKey(behaviour))
            {
                Destroy(_activeSkins[behaviour]);
            }
            else
            {
                _activeSkins.Add(behaviour, null);
            }

            DialogueSystemUISkin skin = null;

            if (_skins.ContainsKey(skinName))
            {
                var go = Instantiate(_skins[skinName].gameObject);
                skin = go.GetComponent <DialogueSystemUISkin>();
                go.transform.SetParent(transform);
                go.transform.localScale = Vector3.one;
                go.SetActive(true);
            }

            _activeSkins[behaviour] = skin;
            return(skin);
        }
 /// <summary>
 /// Shows the skin with the given name, hides the other.
 /// If no name is given, it hides every skin.
 /// </summary>
 /// <param name="skinname"></param>
 void SelectSkin(string skinName)
 {
     if (_activeSkin != null)
     {
         _activeSkin.gameObject.SetActive(false);
         _activeSkin = null;
     }
     if (_skins.ContainsKey(skinName))
     {
         _activeSkin = _skins[skinName];
         _activeSkin.gameObject.SetActive(true);
     }
 }
        void OnEnable()
        {
            myTarget = (DialogueSystemUISkin)target;
            UpdateSkinNames((int)myTarget.UIType);

            FindProperty("Name");
            FindProperty("ActorText");
            FindProperty("ActorName");
            FindProperty("ActorPortrait");
            FindProperty("UseActorName");
            FindProperty("UseActorPortrait");
            FindProperty("Timer");
            FindProperty("UseTimer");
            FindProperty("UIType");
            FindProperty("DynamicAnswerNumber");
            FindProperty("answerKeyBinding");
            FindProperty("FirstOnlyKey");
        }