public override void DrawContent() { base.DrawContent(); VoxelMap map = voxelMap; voxelMap = (VoxelMap)EditorGUILayout.ObjectField(voxelMap, typeof(VoxelMap), true); if (voxelMap != map) { OnVoxelMapChanged(); } if (voxelMap != null) { VoxelSwatch swatch = voxelSwatch; voxelSwatch = (VoxelSwatch)EditorGUILayout.ObjectField(voxelSwatch, typeof(VoxelSwatch), true); if (voxelSwatch != swatch) { OnVoxelSwatchChanged(); } if (voxelSwatch != null) { if (GUILayout.Button("Reload Swatch.")) { voxelSwatch.LoadSwatches(); } } } }
public VSCategory(string _name, string _directoryPath, VoxelSwatch _voxelSwatchReference) { categoryName = _name; directoryPath = _directoryPath; tilegroups = new List <VSTileGroup>(); voxelSwatchReference = _voxelSwatchReference; }
public override void DrawContent () { base.DrawContent(); VoxelMap map = voxelMap; voxelMap = (VoxelMap)EditorGUILayout.ObjectField(voxelMap, typeof(VoxelMap), true); if (voxelMap != map) { OnVoxelMapChanged(); } if (voxelMap != null) { VoxelSwatch swatch = voxelSwatch; voxelSwatch = (VoxelSwatch)EditorGUILayout.ObjectField(voxelSwatch, typeof(VoxelSwatch), true); if (voxelSwatch != swatch) { OnVoxelSwatchChanged(); } if (voxelSwatch != null) { if (GUILayout.Button("Reload Swatch.")) { voxelSwatch.LoadSwatches(); } } } }
/// <summary> /// When the voxel swatch is changed /// </summary> /// <param name="_swatch">the new swatch</param> public void OnVoxelSwatchChanged(VoxelSwatch _swatch) { swatchReference = _swatch; if (swatchReference != null) { SetCategory(0); swatchReference.LoadSwatches(); } }
public override void DrawContent() { base.DrawContent(); EditorGUILayout.BeginHorizontal("box"); VoxelSwatch = (VoxelSwatch)EditorGUILayout.ObjectField(VoxelSwatch, typeof(VoxelSwatch), false, GUILayout.Width(150)); DrawHeaderButtons(); EditorGUILayout.EndHorizontal(); }
private void OnVoxelMapChanged() { if (voxelMap != null) { voxelSwatch = voxelMap.voxelSwatch; } else { } if (OnVoxelMapChangedEvent != null) { OnVoxelMapChangedEvent(voxelMap); } }
/// <summary> /// Sets a new VoxelSwatch. /// </summary> /// <param name="_swatch">The Swatch</param> public void SetVoxelSwatch(VoxelSwatch _swatch) { voxelSwatch = _swatch; if (_swatch != null) { categoryCount = voxelSwatch.categories.Count; } else { categoryCount = 0; } currentCategory = 0; SetCategory(currentCategory); }
/// <summary> /// Called when the swatch is changed. /// </summary> /// <param name="_swatch">The swatch that it is changed into.</param> private void FileManager_OnVoxelSwatchChangedEvent(VoxelSwatch _swatch) { if (_swatch != null) //If theres no swatch selected. { chunkPanel.SetState(true); swatchPanel.SetState(true); swatchPanel.SetVoxelSwatch(_swatch); } else //If there is a swatch selected. { chunkPanel.SetState(false); swatchPanel.SetState(false); swatchPanel.SetVoxelSwatch(null); } }
private void OnVoxelMapChanged () { if (voxelMap != null) { voxelSwatch = voxelMap.voxelSwatch; } else { } if (OnVoxelMapChangedEvent != null) { OnVoxelMapChangedEvent(voxelMap); } }
/// <summary> /// When the voxel swatch is changed /// </summary> /// <param name="_swatch">the new swatch</param> public void OnVoxelSwatchChanged (VoxelSwatch _swatch) { swatchReference = _swatch; if (swatchReference != null) { SetCategory(0); swatchReference.LoadSwatches(); } }
/// <summary> /// Called when the swatch is changed. /// </summary> /// <param name="_swatch">The swatch that it is changed into.</param> private void FileManager_OnVoxelSwatchChangedEvent (VoxelSwatch _swatch) { if (_swatch != null) {//If theres no swatch selected. chunkPanel.SetState(true); swatchPanel.SetState(true); swatchPanel.SetVoxelSwatch(_swatch); } else {//If there is a swatch selected. chunkPanel.SetState(false); swatchPanel.SetState(false); swatchPanel.SetVoxelSwatch(null); } }
public override void DrawContent () { base.DrawContent(); EditorGUILayout.BeginHorizontal("box"); VoxelSwatch = (VoxelSwatch)EditorGUILayout.ObjectField(VoxelSwatch, typeof(VoxelSwatch), false, GUILayout.Width(150)); DrawHeaderButtons(); EditorGUILayout.EndHorizontal(); }
public VSCategory (string _name,string _directoryPath,VoxelSwatch _voxelSwatchReference) { categoryName = _name; directoryPath = _directoryPath; tilegroups = new List<VSTileGroup>(); voxelSwatchReference = _voxelSwatchReference; }
/// <summary> /// Sets a new VoxelSwatch. /// </summary> /// <param name="_swatch">The Swatch</param> public void SetVoxelSwatch (VoxelSwatch _swatch) { voxelSwatch = _swatch; if (_swatch != null) { categoryCount = voxelSwatch.categories.Count; } else { categoryCount = 0; } currentCategory = 0; SetCategory(currentCategory); }
/// <summary> /// When the voxel swatch is changed. /// </summary> /// <param name="_swatch">the new swatch.</param> private void OnVoxelSwatchChangedEvent (VoxelSwatch _swatch) { }
/// <summary> /// When the voxel swatch is changed. /// </summary> /// <param name="_swatch">the new swatch.</param> private void OnVoxelSwatchChangedEvent(VoxelSwatch _swatch) { }