Class UpgradeTreeLayout
- Namespace
- TDMaker.Editor
- Assembly
- TDMaker.Editor.dll
Hand-moved node positions of the Upgrade Tree window, per tree (root tower) and node (tower asset GUIDs). Editor-only: kept in
UserSettings/ of the project, never in the assets or a build.
[FilePath("UserSettings/TDMakerUpgradeTreeLayout.asset", FilePathAttribute.Location.ProjectFolder)]
public sealed class UpgradeTreeLayout : ScriptableSingleton<UpgradeTreeLayout>
- Inheritance
-
ObjectScriptableObjectScriptableSingleton<UpgradeTreeLayout>UpgradeTreeLayout
- Inherited Members
-
ScriptableSingleton<UpgradeTreeLayout>.instanceScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Constructors
UpgradeTreeLayout()
public UpgradeTreeLayout()
Fields
PanKeepVisible
Card pixels that stay on screen at the farthest pan (the whole tree when it is smaller).
public const float PanKeepVisible = 120
Field Value
Methods
ClampPan(Vector2, Rect, Vector2)
Clamps a canvas pan (the content point shown at the view's top-left) to the content bounds expanded by the view size, so
the canvas pans freely even when the tree is smaller than the window, while at least PanKeepVisible pixels
of content (the cards) always stay visible on each axis.
public static Vector2 ClampPan(Vector2 pan, Rect content, Vector2 view)
Parameters
panVector2contentRectviewVector2
Returns
- Vector2
Clear(string)
Forgets every offset of the tree of root.
public void Clear(string root)
Parameters
rootstring
FramePan(Rect, Vector2, float)
The pan that frames content: centred on an axis where it fits the view, otherwise its start (minus
margin) at the view's edge.
public static Vector2 FramePan(Rect content, Vector2 view, float margin)
Parameters
contentRectviewVector2marginfloat
Returns
- Vector2
Get(string, string)
Offset of node in the tree of root (zero when not moved).
public Vector2 Get(string root, string node)
Parameters
Returns
- Vector2
HasAny(string)
Whether any node of the tree of root was moved.
public bool HasAny(string root)
Parameters
rootstring
Returns
Set(string, string, Vector2)
Stores (and saves) an offset; zero removes it.
public void Set(string root, string node, Vector2 offset)
Parameters
WheelPan(Vector2, bool)
Wheel delta to a pan step. Shift turns a vertical wheel into a horizontal pan; a delta that is already horizontal (the editor converts Shift+wheel itself on some platforms, and tilt wheels/trackpads send x) is kept as it is.
public static Vector2 WheelPan(Vector2 delta, bool shift)
Parameters
deltaVector2shiftbool
Returns
- Vector2