IsoTransform#

class in UltimateIsometricToolkit.Scripts.Core / Inherits from MonoBehaviour

Description#

Transform component for isometric objects. Holds position and size and depth from camera's near plane of an isometric object

Every isometric objects has an IsoTransform component attached. IsoTransform hide the regular Transform component in the Inspector window.

Variables#

Type Name Description
bool ShowBounds Flag to draw gizmo bounds of the IsoTransfrom in scene view
Vector3 Position Position in isometric space
Vector3 Size Size in isometric space
Vector3 Min Minimum position in isometric space (readonly)
Vector3 Max Maximum position in isometric space (readonly)
float Depth Depth from near plane, correlates to sorting order

Note

if the ShowBounds flag is set to true and an IsoCollider is attached the display size in the scene view will be the collider's size which may differ from the IsoTransform.Size

Public functions#

void Translate(Vector3 delta)#

Translates the IsoTransform by a given delta

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
public void foo() {
  //move 1 unit along the isometric x axis
  isoTransform.Translate(new Vector3(1,0,0));
}

public void bar() {
  //move with wsad input
  var Speed = 5; //units per second
  isoTransform.Translate(new Vector3(Input.GetAxis("Vertical"), 0, -Input.GetAxis("Horizontal")) * Time.deltaTime * Speed);
}