Пример #1
0
 public static Dictionary <int, string> LoadIndexFile(string fpath)
 {
     if (Application.isPlaying)
     {
         var text = AssetResources.LoadAssetImmediatly(fpath) as TextAsset;
         return(Newtonsoft.Json.JsonConvert.DeserializeObject <Dictionary <int, string> >(text.text, settings));
     }
     else
     {
         var text = Utility.ReadStringFromAbsolutePath(GetRequiredConfigsPath() + fpath);
         return(Newtonsoft.Json.JsonConvert.DeserializeObject <Dictionary <int, string> >(text, settings));
     }
 }
Пример #2
0
        public override void OnAdd()
        {
            base.OnAdd();
            var bt = AssetResources.LoadAssetImmediatly(BtPath) as BTAsset;

            m_behaviourTree = bt;
            m_blackboard    = new Blackboard();
            if (m_behaviourTree != null)
            {
                m_btInstance = m_behaviourTree.CreateRuntimeTree();
            }
            m_timeElapsedSinceLastUpdate = 0.0f;
            m_isRunning = true;
        }
Пример #3
0
 public static T GetTimelineGroup <T>(string path) where T : TimeLineGroup
 {
     if (Application.isPlaying)
     {
         var text = AssetResources.LoadAssetImmediatly(path) as TextAsset;
         T   t    = Newtonsoft.Json.JsonConvert.DeserializeObject <T>(text.text, settings);
         return(t);
     }
     else
     {
         string text = Utility.ReadStringFromAbsolutePath(GetRequiredConfigsPath() + path);
         T      t    = Newtonsoft.Json.JsonConvert.DeserializeObject <T>(text, settings);
         return(t);
     }
 }
Пример #4
0
    public static void Init()
    {
        var txt = AssetResources.LoadAssetImmediatly("armyconf.bytes") as TextAsset;

        Deserialize(txt.bytes);
    }