예제 #1
0
    Dictionary <string, T> LoadTextResource <T>() where T : LoadableResource
    {
        Dictionary <string, T> Dictionary = new Dictionary <string, T>();
        string TypeName = typeof(T).Name + "s";
        //Debug.Log(TypeName);

        List <T> LoadedList = ResourcesMaster.JsonToList <T>(TypeName);
        string   liststring = ResourcesMaster.ListToJson <T>(LoadedList);

        ResourcesMaster.WriteUp(TypeName, liststring);

        string s = TypeName + " ";

        foreach (T item in LoadedList)
        {
            LoadableResource Resource = (LoadableResource)item;
            Dictionary.Add(Resource.Name, item);
            s += Resource.Name + " ";
        }
        Debug.Log(s);

        //facda5//fcd47e
        //f47200
        //ffffb4
        //e36c13
        //ffb313

        return(Dictionary);
    }
예제 #2
0
    void Start()
    {
        // PieceActionsDictionary = new Dictionary<string, PieceAction>();//LoadTextResource<PieceAction>();
        //  PieceEventsDictionary = new Dictionary<string, PieceEvent>();//LoadTextResource<PieceEvent>();
        //PieceModelObjectsDictionary = LoadTextResource<PieceModelObject>();
        //PieceModelTextPanelsDictionary = LoadTextResource<PieceModelTextPanel>();
        //TrackedTagsDictionary = LoadTextResource<TrackedTag>();

        //PieceModelTextPanelsDictionary.Values.ForEach(pm => pm.ModelType = "PieceModelTextPanel");

        PieceActions = ResourcesMaster.JsonToList <PieceAction>("PieceActions");
        string lcsp = ResourcesMaster.ListToJson <PieceAction>(PieceActions);

        foreach (PieceAction pa in PieceActions)
        {
            pa.FullyLoad();
            //PieceActionsDictionary.Add(pa.Name, pa);
        }
        //ResourcesMaster.WriteUp("PieceActions", lcsp);

        SceneSetup = ResourcesMaster.JsonToObject <SceneSetup>("SceneSetup_Torno");
        string sss = ResourcesMaster.ObjectToJson <SceneSetup>(SceneSetup);

        ResourcesMaster.WriteUp("SceneSetupBackup", sss);

        foreach (TrackedAnimationTag Tk in SceneSetup.TrackedAnimationTags)
        {
            foreach (PieceModel Panel in Tk.Panels)
            {
                Panel.FullyLoad();
            }
            foreach (PieceModel Model in Tk.Models)
            {
                Model.FullyLoad();
            }
        }



        //
    }