private void EditingAnActivity() { _editorEffector.SpUpdate(); CreateActivityToolbarArea(); GUILayout.Space(singleLineHeight * 4); _scrollPos = GUILayout.BeginScrollView(_scrollPos, GUILayout.Height(position.height - singleLineHeight * 4)); switch (_editorEffector.CurrentActivityMode()) { case ActivityEditorMode.PreventEyesBlinking: _layoutPreventEyesBlinking.Layout(position); break; case ActivityEditorMode.AdditionalEditors: switch (_editorEffector.GetAdditionalEditor()) { case AdditionalEditorsMode.CreateBlendTrees: _layoutManipulateTrees.LayoutAssetCreator(position); break; case AdditionalEditorsMode.ViewBlendTrees: _layoutManipulateTrees.LayoutTreeViewer(position); break; case AdditionalEditorsMode.CombineFaceExpressions: _layoutFaceExpressionCombiner.Layout(Repaint); break; default: throw new ArgumentOutOfRangeException(); } break; case ActivityEditorMode.OtherOptions: _layoutOtherOptions.Layout(Repaint, position); break; // ReSharper disable once RedundantCaseLabel case ActivityEditorMode.SetFaceExpressions: default: _layoutSetFaceExpressions.Layout(position); break; } GUILayout.EndScrollView(); _editorEffector.ApplyModifiedProperties(); }
private void CreateNewAnimation(string propertyPath) { var animations = _editorEffector.AllDistinctAnimations(); var folder = animations.Count > 0 ? AssetDatabase.GetAssetPath(animations[0]).Replace(Path.GetFileName(AssetDatabase.GetAssetPath(animations[0])), "") : "Assets/"; var finalFilename = "CGE_NewAnimation__" + DateTime.Now.ToString("yyyy'-'MM'-'dd'_'HHmmss") + ".anim"; var finalPath = folder + finalFilename; var clip = new AnimationClip(); AssetDatabase.CreateAsset(clip, finalPath); AssetDatabase.LoadAssetAtPath <AnimationClip>(finalPath); _editorEffector.SpProperty(propertyPath).objectReferenceValue = clip; _editorEffector.ApplyModifiedProperties(); EeAnimationEditorWindow.Obtain().Show(); EditorGUIUtility.PingObject(clip); Selection.SetActiveObjectWithContext(clip, null); }
private void Save(Action repaintCallback) { var savedClip = _combinerState.Combiner.SaveTo(_combinerState.CombinerCandidateFileName); _editorEffector.SpProperty(_combinerState.CombinerTarget).objectReferenceValue = savedClip; _editorEffector.ApplyModifiedProperties(); _activityPreviewQueryAggregator.GenerateMissingPreviews(repaintCallback); if (_combinerState.CombinerIsLikelyEyesClosed) { _editorEffector.GetActivity().blinking.Add(savedClip); } _editorEffector.SwitchTo(ActivityEditorMode.SetFaceExpressions); }