Пример #1
0
        void OnSceneGUI()
        {
            // TODO: add undo/redo functionality
            PolygonSkeleton skeleton = target as PolygonSkeleton;

            if (skeleton == null || !skeleton.boneReferences.IsValid)
            {
                return;
            }

            SkeletonBoneReferences bones = skeleton.boneReferences;

            if (skeleton.newSkeleton.IsValid)
            {
                bones = skeleton.newSkeleton;
            }

            if (skeleton.boneReferences.IsValid)
            {
                DrawHumanoidSkeletonBones(bones);
            }

            if (Selection.activeGameObject != skeleton.gameObject)
            {
                selectedBone = null;
            }
            if (selectedBone != null)
            {
                DrawRotationGizmo(selectedBone);
            }
        }
Пример #2
0
        private void Start()
        {
            polygon     = GetComponent <PolygonSkeleton>();
            boneScalers = polygon.boneScalers;

            debug.SetActive(true);
            model.SetActive(false);
        }
Пример #3
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            PolygonSkeleton script = target as PolygonSkeleton;

            if (GUILayout.Button("Populate Bones"))
            {
                script.PopulateBoneReferences();
            }

            if (GUILayout.Button("Clear Bone References"))
            {
                script.ClearBoneReferences();
            }
        }