{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class HierarchicalSphere | High Definition RP | 6.5.3-preview
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Class HierarchicalSphere

    Provide a gizmo/handle representing a box where all face can be moved independently. Also add a contained sub gizmo/handle box if contained is used at creation.

    상속
    object
    HierarchicalSphere
    상속된 멤버
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    네임스페이스: UnityEditor.Experimental.Rendering
    어셈블리: solution.dll
    구문
    public class HierarchicalSphere
    예
    class MyComponentEditor : Editor
    {
        static HierarchicalSphere sphere;
        static HierarchicalSphere containedSphere;
    
        static MyComponentEditor()
        {
            Color[] handleColors = new Color[]
            {
                Color.red,
                Color.green,
                Color.Blue,
                new Color(0.5f, 0f, 0f, 1f),
                new Color(0f, 0.5f, 0f, 1f),
                new Color(0f, 0f, 0.5f, 1f)
            };
            sphere = new HierarchicalSphere(new Color(1f, 1f, 1f, 0.25));
            containedSphere = new HierarchicalSphere(new Color(1f, 0f, 1f, 0.25), container: sphere);
        }
    
        [DrawGizmo(GizmoType.Selected|GizmoType.Active)]
        void DrawGizmo(MyComponent comp, GizmoType gizmoType)
        {
            sphere.center = comp.transform.position;
            sphere.size = comp.transform.scale;
            sphere.DrawHull(gizmoType == GizmoType.Selected);
    
            containedSphere.center = comp.innerposition;
            containedSphere.size = comp.innerScale;
            containedSphere.DrawHull(gizmoType == GizmoType.Selected);
        }
    
        void OnSceneGUI()
        {
            EditorGUI.BeginChangeCheck();
    
            //container sphere must be also set for contained sphere for clamping
            sphere.center = comp.transform.position;
            sphere.size = comp.transform.scale;
            sphere.DrawHandle();
    
            containedSphere.center = comp.innerposition;
            containedSphere.size = comp.innerScale;
            containedSphere.DrawHandle();
    
            if(EditorGUI.EndChangeCheck())
            {
                comp.innerposition = containedSphere.center;
                comp.innersize = containedSphere.size;
            }
        }
    }

    생성자

    이름 설명
    HierarchicalSphere(Color, HierarchicalSphere)

    Constructor. Used to setup colors and also the container if any.

    프로퍼티

    이름 설명
    baseColor

    The baseColor used to fill hull. All other colors are deduced from it.

    center

    The position of the center of the box in Handle.matrix space.

    radius

    The size of the box in Handle.matrix space.

    메서드

    이름 설명
    DrawHandle()

    Draw the manipulable handles

    DrawHull(bool)

    Draw the hull which means the boxes without the handles

    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)