Asset Hierarchy fileItem 하이라이트 효과 적용 #201
@@ -168,6 +168,7 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
|
- {fileID: 5522365722120041147}
|
||||||
- {fileID: 5951700390897484313}
|
- {fileID: 5951700390897484313}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
@@ -247,9 +248,9 @@ MonoBehaviour:
|
|||||||
m_SelectOnRight: {fileID: 0}
|
m_SelectOnRight: {fileID: 0}
|
||||||
m_Transition: 1
|
m_Transition: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
m_NormalColor: {r: 0.35, g: 0.35, b: 0.35, a: 0}
|
||||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
m_HighlightedColor: {r: 0.65, g: 0.65, b: 0.65, a: 0.29803923}
|
||||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
m_PressedColor: {r: 0.6509804, g: 0.6509804, b: 0.6509804, a: 0.29803923}
|
||||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||||
m_ColorMultiplier: 1
|
m_ColorMultiplier: 1
|
||||||
@@ -266,7 +267,82 @@ MonoBehaviour:
|
|||||||
m_SelectedTrigger: Selected
|
m_SelectedTrigger: Selected
|
||||||
m_DisabledTrigger: Disabled
|
m_DisabledTrigger: Disabled
|
||||||
m_Interactable: 1
|
m_Interactable: 1
|
||||||
m_TargetGraphic: {fileID: 7283401773250522798}
|
m_TargetGraphic: {fileID: 1568911567453506347}
|
||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
|
--- !u!1 &7655375860918751099
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 5522365722120041147}
|
||||||
|
- component: {fileID: 1306554313402992465}
|
||||||
|
- component: {fileID: 1568911567453506347}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Image_Background
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &5522365722120041147
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7655375860918751099}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 2062179146838381722}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!222 &1306554313402992465
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7655375860918751099}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &1568911567453506347
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7655375860918751099}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 0.65, g: 0.65, b: 0.65, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 0}
|
||||||
|
m_Type: 0
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace Studio
|
|||||||
{
|
{
|
||||||
public class UI_AssetHierarchyFileItem : UIBase
|
public class UI_AssetHierarchyFileItem : UIBase
|
||||||
{
|
{
|
||||||
|
private Image Image_Background;
|
||||||
private TextMeshProUGUI Text_AssetName;
|
private TextMeshProUGUI Text_AssetName;
|
||||||
public Action<string, UI_AssetHierarchyFileItem> onClickFileItem;
|
public Action<string, UI_AssetHierarchyFileItem> onClickFileItem;
|
||||||
|
|
||||||
@@ -25,5 +26,13 @@ namespace Studio
|
|||||||
{
|
{
|
||||||
onClickFileItem?.Invoke(Text_AssetName.text, this);
|
onClickFileItem?.Invoke(Text_AssetName.text, this);
|
||||||
}
|
}
|
||||||
|
public void SetBackgroundColor()
|
||||||
|
{
|
||||||
|
Image_Background.color = new Color(0.35f, 0.35f, 0.35f, 0.5f);
|
||||||
|
}
|
||||||
|
public void ResetBackgroundColor()
|
||||||
|
{
|
||||||
|
Image_Background.color = new Color(0.65f, 0.65f, 0.65f, 1f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ namespace Studio
|
|||||||
private RectTransform FoldContent;
|
private RectTransform FoldContent;
|
||||||
|
|
||||||
private UI_AssetHierarchyFileItem prf_assetHierarchyFileItem;
|
private UI_AssetHierarchyFileItem prf_assetHierarchyFileItem;
|
||||||
|
private List<UI_AssetHierarchyFileItem> items = new List<UI_AssetHierarchyFileItem>();
|
||||||
|
private UI_AssetHierarchyFileItem currentItem;
|
||||||
public Action updateLayout;
|
public Action updateLayout;
|
||||||
public Action<string, UI_AssetHierarchyFileItem> onClickFileItem;
|
public Action<string, UI_AssetHierarchyFileItem> onClickFileItem;
|
||||||
public override void AfterAwake()
|
public override void AfterAwake()
|
||||||
@@ -26,13 +28,17 @@ namespace Studio
|
|||||||
Text_FolderName.text = folderName;
|
Text_FolderName.text = folderName;
|
||||||
|
|
||||||
foreach (Transform child in FoldContent)
|
foreach (Transform child in FoldContent)
|
||||||
|
{
|
||||||
Destroy(child.gameObject);
|
Destroy(child.gameObject);
|
||||||
|
}
|
||||||
|
items.Clear();
|
||||||
|
|
||||||
foreach (var file in files)
|
foreach (var file in files)
|
||||||
{
|
{
|
||||||
var item = Instantiate(prf_assetHierarchyFileItem, FoldContent);
|
var item = Instantiate(prf_assetHierarchyFileItem, FoldContent);
|
||||||
item.onClickFileItem += OnClickFileItem;
|
item.onClickFileItem += OnClickFileItem;
|
||||||
item.SetData(file);
|
item.SetData(file);
|
||||||
|
items.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
FoldContent.gameObject.SetActive(Toggle_Fold.isOn);
|
FoldContent.gameObject.SetActive(Toggle_Fold.isOn);
|
||||||
@@ -64,6 +70,13 @@ namespace Studio
|
|||||||
}
|
}
|
||||||
private void OnClickFileItem(string name, UI_AssetHierarchyFileItem item)
|
private void OnClickFileItem(string name, UI_AssetHierarchyFileItem item)
|
||||||
{
|
{
|
||||||
|
if (currentItem != null)
|
||||||
|
{
|
||||||
|
currentItem.ResetBackgroundColor();
|
||||||
|
}
|
||||||
|
currentItem = item;
|
||||||
|
currentItem.SetBackgroundColor();
|
||||||
|
|
||||||
onClickFileItem?.Invoke(name, item);
|
onClickFileItem?.Invoke(name, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace Studio
|
|||||||
{
|
{
|
||||||
public class Panel_AssetInfo : PanelBase
|
public class Panel_AssetInfo : PanelBase
|
||||||
{
|
{
|
||||||
|
private UI_AssetHierarchyFileItem item;
|
||||||
private Button Button_Close;
|
private Button Button_Close;
|
||||||
|
|
||||||
private TextMeshProUGUI AssetName;
|
private TextMeshProUGUI AssetName;
|
||||||
@@ -33,6 +34,7 @@ namespace Studio
|
|||||||
if (targetUI == null || rectTransform == null)
|
if (targetUI == null || rectTransform == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
item = targetUI.GetComponent<UI_AssetHierarchyFileItem>();
|
||||||
SetActive(true);
|
SetActive(true);
|
||||||
|
|
||||||
Vector3[] targetCorners = new Vector3[4];
|
Vector3[] targetCorners = new Vector3[4];
|
||||||
@@ -50,6 +52,7 @@ namespace Studio
|
|||||||
}
|
}
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
item.ResetBackgroundColor();
|
||||||
SetActive(false);
|
SetActive(false);
|
||||||
}
|
}
|
||||||
public void Active(bool isOn)
|
public void Active(bool isOn)
|
||||||
|
|||||||
Reference in New Issue
Block a user