Parkitect Mod Community

Parkitect Mod Community

  • Documentation
  • Blog

›Models And Assets

Starter

  • Starter

Modding

  • IMod Interface
  • Logging
  • Debugging
  • GitHub for beginners
  • Parkitool

Models And Assets

  • Models and Assets
  • Asset Bundle For Beginners
  • Recolorable Objects

Asset Bundles

Some mods requires custom models, that's no problem! You can use Asset Bundles to load custom models and other assets (everything except code). See the Unity tutorial on how to create/use Asset Bundles, click.

When you've made your asset bundles you can include them in your mod. Create a subfolder in your mod 'Asset Bundles'. Now head over to your mod.json and configure it, set AssetBundleDir to 'Asset Bundles' and AssetBundlePrefix to a prefix of your liking. Now when you restart the game, the client will copy all your asset bundles to (Parkitect folder)/Parkitect_Data/StreamingAssets/mods/(your asset bundle prefix). You can reach your asset bundles with the following piece on the following path:

Application.streamingAssetsPath + '/mods/your-prefix/your-asset-bundle-file'

An example to load a custom model:

    using UnityEngine;

    namespace PandaEntertainer
    {
        public class AssetBundleManager
        {
            public readonly GameObject One;
            public readonly GameObject Two;

            public AssetBundleManager(Main main)
            {
                var dsc = System.IO.Path.DirectorySeparatorChar;
                var assetBundle = AssetBundle.LoadFromFile(main.Path + dsc + "assetbundle" + dsc + "assetpack");

                One = assetBundle.LoadAsset<GameObject>("1");
                Two = assetBundle.LoadAsset<GameObject>("2");
                assetBundle.Unload(false);
            }
        }
    }
← ParkitoolAsset Bundle For Beginners →
Parkitect Mod Community
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2020 Your Name or Your Company Name