Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SphereBooster : MonoBehaviour {
// DistanceTextオブジェクトへの参照
GameObject distanceTextObject;
// 既存のメンバ変数は省略
// 以下は Rigidbody rb; の下に。
// DistanceTextオブジェクトのTextコンポーネントへの参照をキャッシュ
Text distanceText;
// UIテキストのプレフィックス
string distancePrefix = "Distance : ";
// UIテキストのサフィックス
string distanceSuffix = " m";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment