Esempio n. 1
0
        private void Awake()
        {
            m_tool   = IOC.Resolve <IProBuilderTool>();
            m_editor = IOC.Resolve <IRuntimeEditor>();
            m_editor.Undo.UndoCompleted += OnUpdateVisualState;
            m_editor.Undo.RedoCompleted += OnUpdateVisualState;
            m_editor.Undo.StateChanged  += OnUpdateVisualState;

            if (m_useGizmosToggle != null)
            {
                m_useGizmosToggle.onValueChanged.AddListener(OnUseGizmosValueChanged);
            }

            if (m_fillModeEditor != null)
            {
                m_fillModeEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.fill), null, "Fill");
            }

            if (m_anchorEditor != null)
            {
                m_anchorEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.anchor), null, "Anchor");
            }

            if (m_offsetEditor != null)
            {
                m_offsetEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.offset), null, "Offset");
            }

            if (m_rotationEditor != null)
            {
                m_rotationEditor.Min = 0;
                m_rotationEditor.Max = 360;
                m_rotationEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.rotation), null, "Rotation");
            }

            if (m_tilingEditor != null)
            {
                m_tilingEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.scale), null, "Tiling");
            }

            if (m_worldSpaceEditor != null)
            {
                m_worldSpaceEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.useWorldSpace), null, "World Space");
            }

            if (m_flipUEditor != null)
            {
                m_flipUEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.flipU), null, "Flip U");
            }

            if (m_flipVEditor != null)
            {
                m_flipVEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.flipV), null, "Flip V");
            }

            if (m_swapUVEditor != null)
            {
                m_swapUVEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.swapUV), null, "Swap UV");
            }
        }
Esempio n. 2
0
        private void Awake()
        {
            m_localization = IOC.Resolve <ILocalization>();

            if (m_createLayer != null)
            {
                m_createLayer.onClick.AddListener(OnCreateLayer);
            }
            if (m_replaceLayer != null)
            {
                m_replaceLayer.onClick.AddListener(OnReplaceLayer);
            }
            if (m_removeLayer != null)
            {
                m_removeLayer.onClick.AddListener(OnRemoveLayer);
            }

            if (m_layersList != null)
            {
                m_layersList.SelectionChanged += OnLayersSelectionChanged;
                m_layersList.ItemDataBinding  += OnLayersDataBinding;
                m_layersList.CanDrag           = false;
                m_layersList.CanEdit           = false;
                m_layersList.CanRemove         = false;
                m_layersList.CanReorder        = false;
                m_layersList.CanReparent       = false;
                m_layersList.CanSelectAll      = false;
            }

            if (m_tileSizeEditor != null)
            {
                m_tileSizeEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileSize), null, m_localization.GetString("ID_RTTerrain_TerrainLayerEditor_TileSize", "Tile Size"), null, null, null, false, null, BeginRecordLayerProperties, EndRecordLayerProperties);
            }
            if (m_tileOffsetEditor != null)
            {
                m_tileOffsetEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileOffset), null, m_localization.GetString("ID_RTTerrain_TerrainLayerEditor_TileOffset", "Tile Offset"), null, null, null, false, null, BeginRecordLayerProperties, EndRecordLayerProperties);
            }
        }
Esempio n. 3
0
        private void Awake()
        {
            if (m_createLayer != null)
            {
                m_createLayer.onClick.AddListener(OnCreateLayer);
            }
            if (m_replaceLayer != null)
            {
                m_replaceLayer.onClick.AddListener(OnReplaceLayer);
            }
            if (m_removeLayer != null)
            {
                m_removeLayer.onClick.AddListener(OnRemoveLayer);
            }

            if (m_layersList != null)
            {
                m_layersList.SelectionChanged += OnLayersSelectionChanged;
                m_layersList.ItemDataBinding  += OnLayersDataBinding;
                m_layersList.CanDrag           = false;
                m_layersList.CanEdit           = false;
                m_layersList.CanRemove         = false;
                m_layersList.CanReorder        = false;
                m_layersList.CanReparent       = false;
                m_layersList.CanSelectAll      = false;
            }

            if (m_tileSizeEditor != null)
            {
                m_tileSizeEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileSize));
            }
            if (m_tileOffsetEditor != null)
            {
                m_tileOffsetEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileOffset));
            }
        }
Esempio n. 4
0
        private void Awake()
        {
            Tool           = IOC.Resolve <IProBuilderTool>();
            m_editor       = IOC.Resolve <IRuntimeEditor>();
            m_localization = IOC.Resolve <ILocalization>();

            if (m_fillModeEditor != null)
            {
                m_fillModeEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.fill), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_Fill", "Fill"));
            }

            if (m_anchorEditor != null)
            {
                m_anchorEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.anchor), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_Anchor", "Anchor"));
            }

            if (m_offsetEditor != null)
            {
                m_offsetEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.offset), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_Offset", "Offset"));
            }

            if (m_rotationEditor != null)
            {
                m_rotationEditor.Min = 0;
                m_rotationEditor.Max = 360;
                m_rotationEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.rotation), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_Rotation", "Rotation"));
            }

            if (m_tilingEditor != null)
            {
                m_tilingEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.scale), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_Tiling", "Tiling"));
            }

            if (m_worldSpaceEditor != null)
            {
                m_worldSpaceEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.useWorldSpace), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_WorldSpace", "World Space"));
            }

            if (m_flipUEditor != null)
            {
                m_flipUEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.flipU), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_FlipU", "Flip U"));
            }

            if (m_flipVEditor != null)
            {
                m_flipVEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.flipV), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_FlipV", "Flip V"));
            }

            if (m_swapUVEditor != null)
            {
                m_swapUVEditor.Init(m_tool.UV, m_tool.UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.swapUV), null, m_localization.GetString("ID_RTBuilder_UVEditorAuto_SwapUV", "Swap UV"));
            }

            if (m_btnGroupFaces != null)
            {
                m_btnGroupFaces.onClick.AddListener(OnGroupFaces);
            }

            if (m_btnUngroupFaces != null)
            {
                m_btnUngroupFaces.onClick.AddListener(OnUngroupFaces);
            }

            if (m_selectFaceGroup != null)
            {
                m_selectFaceGroup.onClick.AddListener(OnSelectFaceGroup);
            }

            if (m_resetUVs != null)
            {
                m_resetUVs.onClick.AddListener(OnResetUVs);
            }
        }