Пример #1
0
    /// <summary>
    /// Preferenece 카테고리 리턴.
    /// </summary>
    public static T Get <T>() where T : LocalPrefsContainer
    {
        // 적절한 타입 찾아서 리턴.
        LocalPrefsContainer container = null;

        if (s_dicCategory.TryGetValue(typeof(T), out container) == true)
        {
            container.Load();
            return((T)container);
        }

        return(null);
    }
Пример #2
0
    public static LocalPrefsContainer Get(Type t)
    {
        // 적절한 타입 찾아서 리턴.
        LocalPrefsContainer container = null;

        if (s_dicCategory.TryGetValue(t, out container) == true)
        {
            container.Load();
            return(container);
        }

        return(null);
    }
Пример #3
0
        /// <summary>
        /// 모든 필드 Clear.
        /// </summary>
        public void Clear()
        {
            Type   thisType    = this.GetType();
            string registerKey = string.Format("{0}{1}", s_strLocalPrefsRoot, thisType.Name);

            if (PlayerPrefs.HasKey(registerKey) == true)
            {
                m_oJson = null;
                PlayerPrefs.DeleteKey(registerKey);
            }

            s_dicCategory.Remove(thisType);
            Activator.CreateInstance(thisType);

            LocalPrefsContainer newContainer = null;

            if (s_dicCategory.TryGetValue(thisType, out newContainer) == true)
            {
                newContainer.Save();
            }
        }