public CharacterProfile FindCharacterProfile(string name, bool createNewIfNotFound) { CharacterProfile foundProfile = GetCharacterProfile(name); if (foundProfile == null && createNewIfNotFound == true) { return(CreateNewCharacterProfile(name)); } return(foundProfile); }
public CharacterProfile CreateNewCharacterProfile(string name) { if(string.Equals(name, string.Empty) == false) { CharacterProfile newProfile = new CharacterProfile(name); AddCharacterProfileToList(newProfile); return newProfile; } else Debug.LogError(this + " - CharacterProfile must have a valid name."); return null; }
private bool RemoveCharacterProfileFromList(CharacterProfile profile) { int objectCount = m_characterProfileList.Count; for(int i = 0; i < objectCount; ++i) { if(profile == m_characterProfileList[i]) { m_characterProfileList.Remove(i); return true; } } return false; }
public CharacterProfile CreateNewCharacterProfile(string name) { if (string.Equals(name, string.Empty) == false) { CharacterProfile newProfile = new CharacterProfile(name); AddCharacterProfileToList(newProfile); return(newProfile); } else { Debug.LogError(this + " - CharacterProfile must have a valid name."); } return(null); }
private bool RemoveCharacterProfileFromList(CharacterProfile profile) { int objectCount = m_characterProfileList.Count; for (int i = 0; i < objectCount; ++i) { if (profile == m_characterProfileList[i]) { m_characterProfileList.Remove(i); return(true); } } return(false); }
protected IEnumerator DelayLoadCharacterProfile(bool ceateIfMissing) { yield return new WaitForEndOfFrame(); m_characterProfile = CharacterProfileHandler.Instance.FindCharacterProfile(Name, ceateIfMissing); }
private void AddCharacterProfileToList(CharacterProfile profile) { m_characterProfileList.Add(m_characterProfileList.Count, profile); }
protected IEnumerator DelayLoadCharacterProfile(bool ceateIfMissing) { yield return(new WaitForEndOfFrame()); m_characterProfile = CharacterProfileHandler.Instance.FindCharacterProfile(Name, ceateIfMissing); }