using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NameChange : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
gameObject.name = "Test";
}
}
ゲーム開始時に「Cube」を「Test」という名前に変更しています。
もちろんこれもできる
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NameChange : MonoBehaviour
{
string cubeName = "Sample";
// Start is called before the first frame update
void Start()
{
gameObject.name = cubeName;
}
}
コメント