Ejemplo n.º 1
0
 void OnEnable()
 {
     if (drawableList == null)
     {
         drawableList = new ScriptableList <U>();
     }
 }
Ejemplo n.º 2
0
    protected override void Awake()
    {
        base.Awake();

        SLinstance = ScriptableList <RoomItemConfig> .instance;
        Messenger.AddListener <FURNITURE>(GameEvents.FURNITURE_CHANGED, InitializeInventory);
    }
Ejemplo n.º 3
0
    protected override void Awake()
    {
        base.Awake();

        SLinstance = ScriptableList <ItemConfig> .instance;

        Messenger.AddListener <GameMode>(GameEvents.INVENTORY_GAME_MODE_CHANGED, GameModeChanged);
        Messenger.AddListener <BODY_PART>(GameEvents.INVENTORY_BODY_PART_CHANGED, BodyPartChanged);

        characterGender = SaveManager.Instance.LoadBody().gender;
    }
Ejemplo n.º 4
0
        public void RecalckHashes()
        {
            int i = 0;

            string[] derictories = Directory.GetDirectories(Application.dataPath + "/Resources/Configs");
            string[] configFiles = Directory.GetFiles(Application.dataPath + "/Resources/Configs", "*.asset", SearchOption.AllDirectories);
            ScriptableList <BaseScriptableDrowableItem> .configHash.hashes.Clear();

            foreach (string configFile in configFiles)
            {
                string     assetPath              = configFile.Replace(Application.dataPath + "/Resources/", "").Replace('\\', '/').Replace(".asset", "");
                ConfigHash _configHash            = AssetDatabase.LoadAssetAtPath(assetPath, typeof(ConfigHash)) as ConfigHash;
                BaseScriptableDrowableItem source = Resources.Load <BaseScriptableDrowableItem>(assetPath);

                if (source != null)
                {
                    string json = JsonConvert.SerializeObject(source, Formatting.Indented,
                                                              new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,

                        NullValueHandling     = NullValueHandling.Ignore,
                        MissingMemberHandling = MissingMemberHandling.Ignore,
                        //Error = HandleDeserializationError,
                        //PreserveReferencesHandling = PreserveReferencesHandling.All
                    }
                                                              );
                    // Debug.Log(json);

                    ScriptableList <BaseScriptableDrowableItem> .SetNewHash(i, assetPath, json);

                    i++;
                }
            }

            AssetDatabase.SaveAssets();
        }