1090715 開啟隱藏和隱藏物件
by 黃國哲 2020-07-15 21:11:47, Reply(0), Views(610)
步驟一:將以下語法貼到大範圍的Image底下,然後設定兩個Button
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class setactive : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{}
// Update is called once per frame
void Update()
{}
public GameObject Map ; //拖曳要控制的物件
public void Active_Map()
{
Map.SetActive(true);
}
public void DeActive_Map()
{
Map.SetActive(false);
}
}
步驟二:將要控制的物件拉到Public後的指定物件位置完成匹配
步驟三:執行後便可以操作了
Reply