Skip to content

Instantly share code, notes, and snippets.

@FUJI-bayashi
Last active June 20, 2023 03:26
Show Gist options
  • Select an option

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

Select an option

Save FUJI-bayashi/1dc014bbf9c4bd5e50a5f9e248e15686 to your computer and use it in GitHub Desktop.
アタッチする必要はない。プロジェクトウインドウのどこかに置いておけばいいだけ。
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MyButtonData
{
[SerializeField] GameObject mySelf;
[SerializeField] Selectable selectable;
[SerializeField] MyButtonController myButtonController;
[SerializeField] int id;
/// <summary>
/// コンストラクタ
/// </summary>
public MyButtonData(GameObject _mySelf, Selectable _selectable, MyButtonController _myButtonController)
{
mySelf = _mySelf;
selectable = _selectable;
myButtonController = _myButtonController;
//Myボタンリストに追加
MyButtonPool.inst.AddMyButtonToPool(this, _myButtonController);
}
//GetSet--------------------------------------------------------------------------------------------------------------------------------------
public MyButtonController GetMyButtonController()
{
return myButtonController;
}
public void SetID(int _id)
{
id = _id;
}
public int GetID()
{
return id;
}
public bool IsNotID(int _id)
{
return id != _id;
}
public string GetDebugString()
{
return "BUTTONDATA [ mySelf=<color=yellow>" + mySelf.name +
"</color>, Selectable=<color=yellow>" + selectable +
"</color>, myButtonController=<color=yellow>" + myButtonController +
"</color>, ID=<color=yellow>" + id+"</color> ]";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment