private void refreshExistingAsset() { if (!string.IsNullOrEmpty(workingName)) { _existingAsset = AssetDatabase.LoadAssetAtPath(workingAssetPath, typeof(RigPoseAsset)) as RigPoseAsset; } else { _existingAsset = null; } }
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; } }