2021-04-15 20:18:03 +10:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace UnityExplorer.UI.Widgets
|
|
|
|
|
{
|
|
|
|
|
public class CachedTransform
|
|
|
|
|
{
|
2021-04-16 02:52:54 +10:00
|
|
|
|
public TransformTree Tree { get; }
|
|
|
|
|
public Transform Value { get; private set; }
|
|
|
|
|
public int InstanceID { get; private set; }
|
2021-04-15 20:18:03 +10:00
|
|
|
|
public CachedTransform Parent { get; internal set; }
|
|
|
|
|
|
|
|
|
|
public int Depth { get; internal set; }
|
|
|
|
|
|
2021-04-16 02:52:54 +10:00
|
|
|
|
public bool Expanded => Tree.IsCellExpanded(InstanceID);
|
2021-04-15 20:18:03 +10:00
|
|
|
|
|
2021-04-26 19:56:21 +10:00
|
|
|
|
public CachedTransform(TransformTree tree, Transform transform, int depth, CachedTransform parent = null)
|
2021-04-15 20:18:03 +10:00
|
|
|
|
{
|
2021-04-16 02:52:54 +10:00
|
|
|
|
Tree = tree;
|
|
|
|
|
Value = transform;
|
2021-04-15 20:18:03 +10:00
|
|
|
|
Parent = parent;
|
2021-04-30 23:43:27 +10:00
|
|
|
|
InstanceID = transform.GetInstanceID();
|
2021-04-26 19:56:21 +10:00
|
|
|
|
Update(transform, depth);
|
2021-04-15 20:18:03 +10:00
|
|
|
|
}
|
|
|
|
|
|
2021-04-26 19:56:21 +10:00
|
|
|
|
public void Update(Transform transform, int depth)
|
2021-04-15 20:18:03 +10:00
|
|
|
|
{
|
2021-04-16 02:52:54 +10:00
|
|
|
|
Value = transform;
|
2021-04-26 19:56:21 +10:00
|
|
|
|
Depth = depth;
|
2021-04-15 20:18:03 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|