Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
SubdivisionUtility.cs
생성일
3년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
3 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
76 행
복사
4 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
77 행
복사
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using UnityEditor;
using UnityEditor;
namespace Torec
namespace Torec
{
{
public class SubdivisionUtility : EditorWindow
public class SubdivisionUtility : EditorWindow
{
{
public SubdivisionUtility() {
public SubdivisionUtility() {
titleContent.text = "Torec/Subdivision";
titleContent.text = "Torec/Subdivision";
}
}
Vector2 selectionScroll = Vector2.zero;
Vector2 selectionScroll = Vector2.zero;
int iterations = 1;
int iterations = 1;
CatmullClark.Options.BoundaryInterpolation boundaryInterpolation;
CatmullClark.Options.BoundaryInterpolation boundaryInterpolation;
void OnGUI() {
void OnGUI() {
EditorGUIUtility.labelWidth = 80;
EditorGUIUtility.labelWidth = 80;
Transform[] selection = Selection.transforms;
Transform[] selection = Selection.transforms;
// Selection
// Selection
EditorGUILayout.BeginHorizontal();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("Selection", GUILayout.Width(80));
EditorGUILayout.LabelField("Selection", GUILayout.Width(80));
selectionScroll = EditorGUILayout.BeginScrollView(selectionScroll);
selectionScroll = EditorGUILayout.BeginScrollView(selectionScroll);
foreach (Transform t in selection) {
foreach (Transform t in selection) {
EditorGUILayout.LabelField(t.name);
EditorGUILayout.LabelField(t.name);
}
}
EditorGUILayout.EndScrollView();
EditorGUILayout.EndScrollView();
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndHorizontal();
// Iterations
// Iterations
iterations = (int)EditorGUILayout.Slider("Iterations", iterations, 1, 5);
iterations = (int)EditorGUILayout.Slider("Iterations", iterations, 1, 5);
// Boundaries
// Boundaries
boundaryInterpolation = (CatmullClark.Options.BoundaryInterpolation)
boundaryInterpolation = (CatmullClark.Options.BoundaryInterpolation)
EditorGUILayout.EnumPopup("Boundaries", boundaryInterpolation);
EditorGUILayout.EnumPopup("Boundaries", boundaryInterpolation);
// Button
// Button
if (GUILayout.Button("Subdivide")) {
if (GUILayout.Button("Subdivide")) {
if (selection.Length == 0) throw new System.Exception("Nothing selected to subdivide");
if (selection.Length == 0) throw new System.Exception("Nothing selected to subdivide");
var options = new CatmullClark.Options {
var options = new CatmullClark.Options {
boundaryInterpolation = boundaryInterpolation,
boundaryInterpolation = boundaryInterpolation,
};
};
foreach (Transform t in selection) {
foreach (Transform t in selection) {
// Add Undo record
// Add Undo record
복사
복사됨
복사
복사됨
MeshFilter mf
= CatmullClark.
CheckMeshFilter
(t.gameObject);
// メソッドの仕様変更に合わせて型を変える
Undo.RecordObject(
mf
, "Subdivide " + t.name);
Component c
= CatmullClark.
CheckMeshComponent
(t.gameObject);
Undo.RecordObject(
c
, "Subdivide " + t.name);
// Subdivide
// Subdivide
CatmullClark.Subdivide(t.gameObject, iterations, options);
CatmullClark.Subdivide(t.gameObject, iterations, options);
}
}
if (selection.Length > 1) {
if (selection.Length > 1) {
Undo.SetCurrentGroupName(string.Format("Subdivide {0} objects", selection.Length));
Undo.SetCurrentGroupName(string.Format("Subdivide {0} objects", selection.Length));
}
}
}
}
}
}
void OnInspectorUpdate() {
void OnInspectorUpdate() {
// Permanently update list of selected objects
// Permanently update list of selected objects
// ~ 10 times per sec
// ~ 10 times per sec
Repaint();
Repaint();
}
}
[MenuItem("Torec/Subdivision")]
[MenuItem("Torec/Subdivision")]
static void ShowSubdivisionUtility() {
static void ShowSubdivisionUtility() {
if (window == null) {
if (window == null) {
window = ScriptableObject.CreateInstance<SubdivisionUtility>();
window = ScriptableObject.CreateInstance<SubdivisionUtility>();
}
}
window.ShowUtility();
window.ShowUtility();
}
}
static private SubdivisionUtility window = null;
static private SubdivisionUtility window = null;
}
}
}
}
저장된 비교 결과
원본
파일 열기
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; namespace Torec { public class SubdivisionUtility : EditorWindow { public SubdivisionUtility() { titleContent.text = "Torec/Subdivision"; } Vector2 selectionScroll = Vector2.zero; int iterations = 1; CatmullClark.Options.BoundaryInterpolation boundaryInterpolation; void OnGUI() { EditorGUIUtility.labelWidth = 80; Transform[] selection = Selection.transforms; // Selection EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Selection", GUILayout.Width(80)); selectionScroll = EditorGUILayout.BeginScrollView(selectionScroll); foreach (Transform t in selection) { EditorGUILayout.LabelField(t.name); } EditorGUILayout.EndScrollView(); EditorGUILayout.EndHorizontal(); // Iterations iterations = (int)EditorGUILayout.Slider("Iterations", iterations, 1, 5); // Boundaries boundaryInterpolation = (CatmullClark.Options.BoundaryInterpolation) EditorGUILayout.EnumPopup("Boundaries", boundaryInterpolation); // Button if (GUILayout.Button("Subdivide")) { if (selection.Length == 0) throw new System.Exception("Nothing selected to subdivide"); var options = new CatmullClark.Options { boundaryInterpolation = boundaryInterpolation, }; foreach (Transform t in selection) { // Add Undo record MeshFilter mf = CatmullClark.CheckMeshFilter(t.gameObject); Undo.RecordObject(mf, "Subdivide " + t.name); // Subdivide CatmullClark.Subdivide(t.gameObject, iterations, options); } if (selection.Length > 1) { Undo.SetCurrentGroupName(string.Format("Subdivide {0} objects", selection.Length)); } } } void OnInspectorUpdate() { // Permanently update list of selected objects // ~ 10 times per sec Repaint(); } [MenuItem("Torec/Subdivision")] static void ShowSubdivisionUtility() { if (window == null) { window = ScriptableObject.CreateInstance<SubdivisionUtility>(); } window.ShowUtility(); } static private SubdivisionUtility window = null; } }
수정본
파일 열기
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; namespace Torec { public class SubdivisionUtility : EditorWindow { public SubdivisionUtility() { titleContent.text = "Torec/Subdivision"; } Vector2 selectionScroll = Vector2.zero; int iterations = 1; CatmullClark.Options.BoundaryInterpolation boundaryInterpolation; void OnGUI() { EditorGUIUtility.labelWidth = 80; Transform[] selection = Selection.transforms; // Selection EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Selection", GUILayout.Width(80)); selectionScroll = EditorGUILayout.BeginScrollView(selectionScroll); foreach (Transform t in selection) { EditorGUILayout.LabelField(t.name); } EditorGUILayout.EndScrollView(); EditorGUILayout.EndHorizontal(); // Iterations iterations = (int)EditorGUILayout.Slider("Iterations", iterations, 1, 5); // Boundaries boundaryInterpolation = (CatmullClark.Options.BoundaryInterpolation) EditorGUILayout.EnumPopup("Boundaries", boundaryInterpolation); // Button if (GUILayout.Button("Subdivide")) { if (selection.Length == 0) throw new System.Exception("Nothing selected to subdivide"); var options = new CatmullClark.Options { boundaryInterpolation = boundaryInterpolation, }; foreach (Transform t in selection) { // Add Undo record // メソッドの仕様変更に合わせて型を変える Component c = CatmullClark.CheckMeshComponent(t.gameObject); Undo.RecordObject(c, "Subdivide " + t.name); // Subdivide CatmullClark.Subdivide(t.gameObject, iterations, options); } if (selection.Length > 1) { Undo.SetCurrentGroupName(string.Format("Subdivide {0} objects", selection.Length)); } } } void OnInspectorUpdate() { // Permanently update list of selected objects // ~ 10 times per sec Repaint(); } [MenuItem("Torec/Subdivision")] static void ShowSubdivisionUtility() { if (window == null) { window = ScriptableObject.CreateInstance<SubdivisionUtility>(); } window.ShowUtility(); } static private SubdivisionUtility window = null; } }
비교하기