示例#1
0
 public void SetCurrentCharacter(CharacterProfile character)
 {
     // TODO: may need to find a place to make sure this is unset/reset to some
     // default...
     currentCharacter = character;
     ApplyColors(character);
 }
示例#2
0
 public void ApplyColors(CharacterProfile profile)
 {
     ApplyColors(
         profile.PrimaryColor,
         profile.SecondaryColor,
         profile.TextColor
         );
 }
示例#3
0
        public void StartTalking(CharacterProfile character)
        {
            string key = GetCharacterKey(character);

            if (MapCache.ContainsKey(key))
            {
                Animator anim = MapCache[key];
                if (AnimationTools.HasParameter(anim, TALKING_TRIGGER) && AnimationTools.HasParameter(anim, IDLE_TRIGGER))
                {
                    anim.ResetTrigger(IDLE_TRIGGER);
                    anim.SetTrigger(TALKING_TRIGGER);
                }
            }
        }
示例#4
0
        //---------------------------------------------------------------------
        // Odin Inspector
        //---------------------------------------------------------------------
        public IEnumerable GetProfiles()
        {
            List <CharacterProfile> initialProfileList = new List <CharacterProfile>();

      #if UNITY_EDITOR
            initialProfileList = EditorUtils.FindAssetsByType <CharacterProfile>();
      #endif

            CharacterProfile defaultProfile = null;

            SortedDictionary <int, List <CharacterProfile> > separated = new SortedDictionary <int, List <CharacterProfile> >();
            foreach (CharacterProfile profile in initialProfileList)
            {
                if (profile.Category == CharacterCategory.Default)
                {
                    defaultProfile = profile;
                }
                else
                {
                    int cat = (int)profile.Category;
                    if (!separated.ContainsKey(cat))
                    {
                        separated.Add(cat, new List <CharacterProfile>());
                    }

                    separated[cat].Add(profile);
                }
            }

            ValueDropdownList <CharacterProfile> ordered = new ValueDropdownList <CharacterProfile>();
            ordered.Add("Default", defaultProfile);
            foreach (int cat in separated.Keys)
            {
                string categoryName = ((CharacterCategory)cat).ToString();
                foreach (CharacterProfile profile in separated[cat])
                {
                    string path = categoryName + "/" + profile.CharacterName;
                    ordered.Add(path, profile);
                }
            }

            return(ordered);
        }
示例#5
0
        public void StopTalking(CharacterProfile character)
        {
            string key = GetCharacterKey(character);

            StopTalking(key);
        }
示例#6
0
 private string GetCharacterKey(CharacterProfile character) => character.Category.ToString() + "/" + character.CharacterName;