public void OnEditorGUI() { animator = (VoxelAnimator)target; EditorGUILayout.BeginHorizontal(GUILayout.Width(paramViewWidth)); ParameterView(); EditorGUILayout.EndHorizontal(); }
void AddToAnimationList(List <VoxelAnimator> lstAnimations, VoxelAnimator anim) { if (anim != null) { lstAnimations.Add(anim); } }
void Awake() { forward = Camera.main.transform.forward; forward.y = 0; forward.Normalize(); right = Quaternion.Euler(new Vector3(0, 90, 0)) * forward; rb = GetComponent <Rigidbody>(); playerInput = GetComponent <PlayerInputHandler>(); playerController = GetComponent <PlayerController>(); minInput = playerController.GetMinInput(); buildUpRot = playerController.GetBuildUpRot(); animator = GetComponent <VoxelAnimator>(); }
void ParameterColumn() { bool recreateEditor = false; EditorGUILayout.BeginVertical(GUILayout.Width(paramViewHeight)); if (Selection.activeGameObject != selected) { recreateEditor = true; selected = Selection.activeGameObject; } if (selected != null) { animator = selected.GetComponent <VoxelAnimator>(); if (animator != null) { if (recreateEditor) { editor = (VoxelAnimatorEditor)Editor.CreateEditor(animator); } editor.OnEditorGUI(); } } EditorGUILayout.EndVertical(); }