示例#1
0
 private void refreshExistingAsset()
 {
     if (!string.IsNullOrEmpty(workingName))
     {
         _existingAsset
             = AssetDatabase.LoadAssetAtPath(workingAssetPath, typeof(RigPoseAsset))
               as RigPoseAsset;
     }
     else
     {
         _existingAsset = null;
     }
 }
示例#2
0
        private void tryEnsureWorkingAssetExists()
        {
            if (hasExistingAsset)
            {
                return;
            }
            else if (string.IsNullOrEmpty(workingName))
            {
                return;
            }
            else
            {
                var newRigPoseAsset = ScriptableObject.CreateInstance <RigPoseAsset>();
                newRigPoseAsset.rigPose = currRigPose;
                AssetDatabase.CreateAsset(newRigPoseAsset, workingAssetPath);
                AssetDatabase.SaveAssets();

                _existingAsset = newRigPoseAsset;
            }
        }