예제 #1
0
    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());
    }
예제 #2
0
    // 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();
        }
    }