LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 3 years have passed since last update.

【Unity】脱出ゲームの作り方 #1 クリックイベントによるパネルの表示

Posted at

画像ファイルダウンロード:https://drive.google.com/open?id=1ClAAZd-A6YYW1OAAdXDQ-el_k0AmrZgk

ソースコード

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    // 各パネルを取得
    public GameObject lightStandPanel;
    public GameObject drawerPanel;
    public GameObject pcPanel;

    // ボタンを押したら該当するパネルを表示
    public void OnClickLightStandTrigger()
    {
        lightStandPanel.SetActive(true);
    }
    public void OnClickDrawerTrigger()
    {
        drawerPanel.SetActive(true);
    }
    public void OnClickPCTrigger()
    {
        pcPanel.SetActive(true);
    }
}
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up