void OnEnable() { _isoObj = target as IsoObject; _nodeX = _isoObj.nodeX; _nodeZ = _isoObj.nodeZ; _spanX = _isoObj.spanX; _spanZ = _isoObj.spanZ; _rotateX = serializedObject.FindProperty("m_isRotated").boolValue; }
public override void UpdateFrame() { if (m_OrderInvalid) { m_OrderInvalid = false; for (int i = 0; i < transform.childCount; ++i) { Transform child = transform.GetChild(i); IsoObject obj = child.GetComponent <IsoObject>(); obj.UpdateFrame(); Vector3 v = child.localPosition; v.z = -i; child.localPosition = v; } } else { foreach (IsoObject obj in m_sprites) { obj.UpdateFrame(); } } }
public void RemoveIsoObject(IsoObject obj) { m_sprites.Remove(obj); Destroy(obj.gameObject); }
public void AddIsoObject(IsoObject obj) { obj.transform.parent = transform; m_sprites.Add(obj); }