Esempio n. 1
0
        private void OnPacksLoadedSetup()
        {
            var item = ResourcesPrefabManager.Instance.GetItemPrefab(TOOLBOX_ID);

            var desc = item.Description;

            desc = desc.Replace("%COST%", ToolboxScrapCostPerUse.Value.ToString());
            CustomItems.SetDescription(item, desc);

            var stats = new SL_ItemStats()
            {
                BaseValue     = ToolboxSilverCostFromStore.Value,
                MaxDurability = 100,
                RawWeight     = 5.0f,
            };

            stats.ApplyToItem(item.GetComponent <ItemStats>());

            // add our custom effect
            var effects = new GameObject("Effects");

            effects.transform.parent = item.transform;
            effects.AddComponent <ToolboxEffect>();
        }
        // Set up the Toolbox item prefab

        private void SetupToolboxItem()
        {
            var item = ResourcesPrefabManager.Instance.GetItemPrefab(TOOLBOX_ID);

            var desc = item.Description;

            desc = desc.Replace("%COST%", settings.Iron_Scrap_Cost.ToString());
            CustomItems.SetDescription(item, desc);

            var stats = new SL_ItemStats()
            {
                BaseValue     = settings.Toolbox_Cost,
                MaxDurability = 100,
                RawWeight     = 5.0f,
            };

            stats.ApplyToItem(item.GetComponent <ItemStats>());

            // add our custom effect
            var effects = new GameObject("Effects");

            effects.transform.parent = item.transform;
            effects.AddComponent <ToolboxEffect>();
        }