void EnableButton()//激活按钮预制体 { //print("进入物品区域"); mButton = Instantiate(moveObjButton); mButton.SetPlayerAndObj(playerOb, thisTransf); //mButton.SetObjType(transform, objType); mButton.Fade_Appear(0.2f); }
private ButtonObjMove mButton; //按钮方法 //private int Type = 1;//0代表cube,1代表木头,2代表石头 // Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player").transform; moveObjButton = Resources.Load <ButtonObjMove>("Prefabs/UIElement-Button-MoveObj"); playerOb = player.GetComponent <PlayerObj>();//玩家脚本 thisTransf = this.transform; entered = false; }