示例#1
0
    void SavePreferences()
    {
        preferences = new AnimationBakerPreferences();
        int i;
        string curPath;
        if(animationsList.Length>0){
            for(i=0;i<animationsList.Length;i++){
                if(animationsList[i].clip!=null){
                    curPath = AssetDatabase.GetAssetPath(animationsList[i].clip);
                    if(!string.IsNullOrEmpty(curPath))
                        ArrayUtility.Add (ref preferences.animationsPaths,curPath);
                }
            }
        }

        if(charactersList.Length>0){
            for(i=0;i<charactersList.Length;i++){
                if(charactersList[i]!=null){
                    curPath = AssetDatabase.GetAssetPath(charactersList[i]);
                    if(!string.IsNullOrEmpty(curPath))
                        ArrayUtility.Add (ref preferences.charactersPaths,curPath);
                }
            }
        }
        preferences.frameRate = sampleRate;
        preferencesFilePath = preferencesFolderPath+"/preferences.aprf";
        EditorPrefs.SetString("preferencesFolder",preferencesFolderPath);
        BINS.Save (preferences,preferencesFilePath);
    }
示例#2
0
 void OnEnable()
 {
     string prfPath = "";
     baseController = AssetDatabase.LoadAssetAtPath("Assets/AnimationBaker/Core/aB_Animator.controller",typeof(RuntimeAnimatorController)) as RuntimeAnimatorController;
     if(!playButtonPressed && !startRecord && charactersList.Length<1 && animationsList.Length<1){
         prfPath = EditorPrefs.GetString("preferencesFolder");
         if(!string.IsNullOrEmpty(prfPath))
             preferencesFolderPath = prfPath;
         preferencesFilePath = preferencesFolderPath+"/preferences.aprf";
     preferences = (AnimationBakerPreferences) BINS.Load (preferencesFilePath);
         if(preferences!=null)
             AssignPreferences();
         }
 }