Example #1
0
        public override VisualElement CreatePropertyGUI(SerializedProperty property)
        {
            VoxelUVMap uvMap     = (VoxelUVMap)property.GetValue();
            var        container = new VisualElement();

            /*Label newLabel = new Label();
             * newLabel.text = "Uvs [" + uvMap.uvs.Length + "]";
             * container.Add(newLabel);*/
            container.styleSheets.Add(Resources.Load <StyleSheet>("VoxelUvMapEditor/VoxelUvMapEditor"));
            var quickToolVisualTree = Resources.Load <VisualTreeAsset>("VoxelUvMapEditor/VoxelUvMapEditor");

            quickToolVisualTree.CloneTree(container);
            Label uvsLengthLabel = container.Query("uvsLengthLabel").First() as Label;

            uvsLengthLabel.text = "Uvs [" + uvMap.uvs.Length + "]";
            return(container);
        }
Example #2
0
        /*[ContextMenu("Generate UVs")]
         * public void GenerateUVs()
         * {
         *  // using mesh datam -
         *  // if one texture
         * }*/

        public void InitializeCubeMap()
        {
            uvMap = new VoxelUVMap();
            uvMap.Initialize(); // for cube!
        }