jjzjj

【Unity学习笔记】基础游戏单位GameObject中常用的属性和API

一、GameObject中的成员变量主要思想:得到该脚本依附的GameObject的相关信息现有:Lesson4的代码:usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;publicclassLesson4:MonoBehaviour{voidStart(){//1.得到名字print(this.gameObject.name);//2.更改名字this.gameObject.name="Lesson4的新名字";print(this.gameObject.name);//3.得到是否激活print

【Unity学习笔记】基础游戏单位GameObject中常用的属性和API

一、GameObject中的成员变量主要思想:得到该脚本依附的GameObject的相关信息现有:Lesson4的代码:usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;publicclassLesson4:MonoBehaviour{voidStart(){//1.得到名字print(this.gameObject.name);//2.更改名字this.gameObject.name="Lesson4的新名字";print(this.gameObject.name);//3.得到是否激活print