// Token: 0x0600150A RID: 5386 RVA: 0x00059C0C File Offset: 0x00057E0C private void Start() { if (!this.generateDefaultPosition) { this.generateDefaultPosition = true; this.defaultPosition = base.transform.position; } if (this.targetTransform) { this.yOffset = PositionIndicator.CalcHeadOffset(this.targetTransform) + 1f; } }
// Token: 0x06001510 RID: 5392 RVA: 0x00059D54 File Offset: 0x00057F54 private static void UpdatePositions(UICamera uiCamera) { Camera sceneCam = uiCamera.cameraRigController.sceneCam; Camera camera = uiCamera.camera; Rect pixelRect = camera.pixelRect; Vector2 center = pixelRect.center; pixelRect.size *= 0.95f; pixelRect.center = center; Vector2 center2 = pixelRect.center; float num = 1f / (pixelRect.width * 0.5f); float num2 = 1f / (pixelRect.height * 0.5f); Quaternion rotation = uiCamera.transform.rotation; CameraRigController cameraRigController = uiCamera.cameraRigController; Transform y = null; if (cameraRigController && cameraRigController.target) { CharacterBody component = cameraRigController.target.GetComponent <CharacterBody>(); if (component) { y = component.coreTransform; } else { y = cameraRigController.target.transform; } } for (int i = 0; i < PositionIndicator.instancesList.Count; i++) { PositionIndicator positionIndicator = PositionIndicator.instancesList[i]; bool flag = false; bool flag2 = false; bool active = false; float num3 = 0f; if (PositionIndicator.cvPositionIndicatorsEnable.value) { Vector3 a = positionIndicator.targetTransform ? positionIndicator.targetTransform.position : positionIndicator.defaultPosition; if (!positionIndicator.targetTransform || (positionIndicator.targetTransform && positionIndicator.targetTransform != y)) { active = true; Vector3 vector = sceneCam.WorldToScreenPoint(a + new Vector3(0f, positionIndicator.yOffset, 0f)); bool flag3 = vector.z <= 0f; bool flag4 = !flag3 && pixelRect.Contains(vector); if (!flag4) { Vector2 vector2 = vector - center2; float a2 = Mathf.Abs(vector2.x * num); float b = Mathf.Abs(vector2.y * num2); float d = Mathf.Max(a2, b); vector2 /= d; vector2 *= (flag3 ? -1f : 1f); vector = vector2 + center2; if (positionIndicator.shouldRotateOutsideViewObject) { num3 = Mathf.Atan2(vector2.y, vector2.x) * 57.29578f; } } flag = flag4; flag2 = !flag4; vector.z = 1f; Vector3 position = camera.ScreenToWorldPoint(vector); positionIndicator.transform.SetPositionAndRotation(position, rotation); } } if (positionIndicator.alwaysVisibleObject) { positionIndicator.alwaysVisibleObject.SetActive(active); } if (positionIndicator.insideViewObject == positionIndicator.outsideViewObject) { if (positionIndicator.insideViewObject) { positionIndicator.insideViewObject.SetActive(flag || flag2); } } else { if (positionIndicator.insideViewObject) { positionIndicator.insideViewObject.SetActive(flag); } if (positionIndicator.outsideViewObject) { positionIndicator.outsideViewObject.SetActive(flag2); if (flag2 && positionIndicator.shouldRotateOutsideViewObject) { positionIndicator.outsideViewObject.transform.localEulerAngles = new Vector3(0f, 0f, num3 + positionIndicator.outsideViewRotationOffset); } } } } }