一.GameObject中的成员变量 主要思想:得到该脚本依附的GameObject的相关信息 现有: Lesson4的代码: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Lesson4 : MonoBehaviour { void Start() { //1.得到名字 print(this.gameObject.name); //2.更改名字 this.g…
先来看一下界面: 游戏帮助类 class GameCore { //游戏地图 private int[,] map = new int[4, 4]; //合并时用到的临时数组 private int[] mergeArr = new int[4]; //空位数量 private int emptyCount = 16; //所有空位位置 private Location[] emptyArr = new Location[16]; private Random random = new Rand…