Color reset support
This commit is contained in:
parent
b7787579f5
commit
728f378451
|
|
@ -21275,7 +21275,7 @@ MonoBehaviour:
|
|||
m_TargetGraphic: {fileID: 1589389272}
|
||||
m_HandleRect: {fileID: 1589389271}
|
||||
m_Direction: 2
|
||||
m_Value: 1
|
||||
m_Value: 0
|
||||
m_Size: 1
|
||||
m_NumberOfSteps: 0
|
||||
m_OnValueChanged:
|
||||
|
|
@ -31505,7 +31505,7 @@ RectTransform:
|
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 459.58514, y: -185}
|
||||
m_AnchoredPosition: {x: 459.58514, y: -25}
|
||||
m_SizeDelta: {x: 879.1703, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1443721748
|
||||
|
|
@ -33371,7 +33371,7 @@ MonoBehaviour:
|
|||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_ActiveFontFeatures: 00000000
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
|
|
@ -34048,6 +34048,7 @@ GameObject:
|
|||
- component: {fileID: 1535224919}
|
||||
- component: {fileID: 1535224918}
|
||||
- component: {fileID: 1535224921}
|
||||
- component: {fileID: 1535224922}
|
||||
m_Layer: 5
|
||||
m_Name: ColorBTN
|
||||
m_TagString: Untagged
|
||||
|
|
@ -34172,6 +34173,37 @@ MonoBehaviour:
|
|||
previewGraphic: {fileID: 1535224919}
|
||||
colorPicker: {fileID: 1489888672}
|
||||
hex: {fileID: 426555699}
|
||||
--- !u!114 &1535224922
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1535224916}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e4972b7ea15fb7943ad12ed39e229140, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_events:
|
||||
- name: Reset
|
||||
action:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 1443721748}
|
||||
m_TargetAssemblyTypeName: HeavenStudio.Editor.ColorPropertyPrefab, Assembly-CSharp
|
||||
m_MethodName: ResetValue
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
_masterTrans: {fileID: 1791483803}
|
||||
_dropDown: {fileID: 8384641343036272350, guid: 56a45ac5cd0da2a4ab398d1a63e18d9f, type: 3}
|
||||
--- !u!1 &1536668598
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -34394,7 +34426,7 @@ MonoBehaviour:
|
|||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_ActiveFontFeatures: 00000000
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 1
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
|
|
|
|||
|
|
@ -57,6 +57,11 @@ namespace HeavenStudio.Editor
|
|||
ColorTable.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void ResetValue()
|
||||
{
|
||||
colorPreview.ChangeColor(_defaultColor);
|
||||
}
|
||||
|
||||
public override void SetCollapses(object type)
|
||||
{
|
||||
colorPreview.colorPicker.onColorChanged += _ => UpdateCollapse(colorPreview.colorPicker.color);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace HeavenStudio.Common
|
|||
spawnedButton.onClick.AddListener(new UnityAction(() =>
|
||||
{
|
||||
e.action.Invoke();
|
||||
Destroy(_currentDropDown.gameObject);
|
||||
if (_currentDropDown != null) Destroy(_currentDropDown.gameObject);
|
||||
}));
|
||||
spawnedButton.transform.GetChild(0).GetComponent<TMP_Text>().text = e.name;
|
||||
spawnedButton.gameObject.SetActive(true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue