Flight Engineer displayability also takes into account the main canvas enabled state (hides on F2).
[VesselSimulator.git] / KerbalEngineer / AssetBundleLoader.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace KerbalEngineer
{
    using UnityEngine;
 
    [KSPAddon(KSPAddon.Startup.Instantly, false)]
    public class AssetBundleLoader : MonoBehaviour
    {
        private static AssetBundle m_Images;
        private static AssetBundle m_Prefabs;
 
        /// <summary>
        ///     Gets the loaded images asset bundle.
        /// </summary>
        public static AssetBundle images
        {
            get
            {
                return m_Images;
            }
        }
 
        /// <summary>
        ///     Gets the loaded prefabs asset bundle.
        /// </summary>
        public static AssetBundle prefabs
        {
            get
            {
                return m_Prefabs;
            }
        }
 
        protected virtual void Awake()
        {
            string bundlePath = EngineerGlobals.AssemblyPath;
 
            m_Images = AssetBundle.CreateFromFile(bundlePath + "/images");
            m_Prefabs = AssetBundle.CreateFromFile(bundlePath + "/prefabs");
        }
    }
}