private void LateStart() { arenaAbs = new Rect(inner.position.x - inner.rect.width / 2, inner.position.y - inner.rect.height / 2, inner.rect.width, inner.rect.height); arenaCenter = RTUtil.AbsCenterOf(inner); currentX = inner.rect.width; currentY = inner.rect.height; }
private void LateStart() { try { if (inner == null || outer == null) { UnitaleUtil.WriteInLogAndDebugger(outer == null && inner == null ? "outer & inner = null" : (outer == null ? "outer == null" : "inner == null")); inner = GameObject.Find("arena").GetComponent <RectTransform>(); outer = inner.parent.GetComponent <RectTransform>(); } arenaAbs = new Rect(inner.position.x - inner.sizeDelta.x / 2, inner.position.y - inner.sizeDelta.y / 2, inner.rect.width, inner.rect.height); arenaCenter = RTUtil.AbsCenterOf(inner); newX = currentX = 320; newY = currentY = 90; currentWidth = inner.rect.width; currentHeight = inner.rect.height; basisCoordinates = arenaCenter; } catch { LateUpdater.lateActions.Add(LateStart); UnitaleUtil.WriteInLogAndDebugger("Error during the Arena's initialization! (#" + errCount++ + ")"); } //outer.localPosition = new Vector3(0, -50, 0); //outer.position = new Vector3(320, 90, outer.position.z); }