private void AddState(Type iType)
        {
            ICoreState state = Activator.CreateInstance(iType) as ICoreState;

            if (state == null)
            {
                return;
            }

            CoreStateAttribute attr = Attribute.GetCustomAttribute(iType, typeof(CoreStateAttribute)) as CoreStateAttribute;

            if (attr == null)
            {
                Debug.LogErrorFormat("[CoreStatemanager] ICoreState: {0} has no CoreStateAttribute.", state.GetType().FullName);
                return;
            }

            if (stateDic.ContainsKey(attr.id))
            {
                Debug.LogErrorFormat("[CoreStatemanager] ICoreState: {0} is duplicated.", attr.id);
                return;
            }

            stateDic.Add(attr.id, state);
        }
        public T GetState <T>() where T : ICoreState
        {
            CoreStateAttribute attr = Attribute.GetCustomAttribute(typeof(T), typeof(CoreStateAttribute)) as CoreStateAttribute;

            if (attr == null)
            {
                return(null);
            }

            if (stateDic.ContainsKey(attr.id))
            {
                return(stateDic[attr.id] as T);
            }

            return(null);
        }