public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { MapCoordinates coordinates = new MapCoordinates(property.FindPropertyRelative("x").intValue, property.FindPropertyRelative("z").intValue); position = EditorGUI.PrefixLabel(position, label); GUI.Label(position, coordinates.ToString()); }
// Update is called once per frame void Update() { if (CurrentReloadTimer < ReloadTimer && !reloaded) { CurrentReloadTimer += Time.deltaTime; } else { Reload(); CurrentReloadTimer = 0; } TargetPlayer.UpdatePosition(); if (ownPositionTimer <= 0) { ownPositionTimer = ownPositionFrequency; StartCoroutine(BlinkPlayer()); } else { ownPositionTimer -= Time.deltaTime; } MapCoordinates coordinates = MapCoordinates.ToMapCoordinates(GetPosition()); LocalPlayer.data.latitude = coordinates.Latitude; LocalPlayer.data.longitude = coordinates.Longitude; DebugText.text = coordinates.ToString(); if (Time.time > nextActionTime) { nextActionTime = Time.time + period; if (!waitingResponse && !string.IsNullOrEmpty(TargetPlayer.data.id)) { StartCoroutine(GetOpponentPosition(coordinates)); } } if (Input.GetMouseButtonDown(0)) { Tapped(); } }