Skip to content

Instantly share code, notes, and snippets.

@FUJI-bayashi
Created June 20, 2023 03:18
Show Gist options
  • Select an option

  • Save FUJI-bayashi/a8e4bfeb92105cc572028062b1ae673d to your computer and use it in GitHub Desktop.

Select an option

Save FUJI-bayashi/a8e4bfeb92105cc572028062b1ae673d to your computer and use it in GitHub Desktop.
MyButtonControllerを全部アクティブにしたり非アクティブにしたりするためのクラス。これをアタッチしたオブジェクトをシーンに一つ置いておく。
using UnityEngine;
public class MyButtonActivator : MonoBehaviour
{
static public MyButtonActivator inst;
void Awake()
{
inst = this;
}
//ButtonActivate-------------------------------------------------------------------------------
public void ActivateAllButton_WithoutMe(int _activeButtonId)
{
foreach (var item in MyButtonPool.inst.GetButtonDataList())
{
item.GetMyButtonController().ButtonActive(item.IsNotID(_activeButtonId));
}
}
public void ActivateAllButton()
{
foreach (var item in MyButtonPool.inst.GetButtonDataList())
{
item.GetMyButtonController().ButtonActive(true);
}
}
public void DeactivateAllButton()
{
foreach (var item in MyButtonPool.inst.GetButtonDataList())
{
item.GetMyButtonController().ButtonActive(false);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment