IsoSorting#

class in UltimateIsometricToolkit.Scripts.Core / Inherits from MonoBehaviour

Description#

Single most important component in an isometric scene. Handles the sorting of all IsoTransforms at runtime

Variables#

Type Name Description
<static> IsoSorting Instance Singleton access
Projection Projection Current projection used (Isometric, Dimetric, Military, etc.)
float XRot Global x axis rotation
float YRot Global y axis rotation
bool Dirty Dirty flag that will invoke resorting in the next frame
SortingStrategy SortingStrategy Current sorting strategy.

Public functions#


void Resolve(IsoTransform isoTransform)#

Reorders isoTransform in the according to strategy and sets Dirty flag.

1
2
3
4
5
6
7
8
public void foo() {
  // fetch component
  var isoTransform = GetComponent<IsoTransform>();
  //move object 5 units forward
  isoTransform.Translate(Vector3.forward * 5);
  //manually mark object to be resorted (happens under the hood anyways)
  IsoSorting.Instance.Resolve(isoTransform)
}

void Remove(IsoTransform isoTransform)#

Removes the isoTransform from the current set of IsoTransforms to be sorted.

1
2
3
4
5
6
public void foo() {
 var isoTransfrom = GetComponent<IsoTransform>();
 //clean up before deleting obejcts (happens in OnDelete event anyways)
 IsoSorting.Instance.Remove(isoTransform);
 Destroy(this.gameObject);
}