38 lines
936 B
C#
38 lines
936 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using ZXing.QrCode.Internal;
|
|
|
|
namespace BITKit
|
|
{
|
|
public interface IPoolObject
|
|
{
|
|
ValidHandle EnabledHandle { get; }
|
|
}
|
|
[CustomType(typeof(IPoolObject))]
|
|
public class PoolObject : MonoBehaviour, IPoolObject
|
|
{
|
|
[SerializeField, ReadOnly] private bool isEnabled;
|
|
[SerializeField, ReadOnly(HideLabel = true), TextArea] private string report;
|
|
public ValidHandle EnabledHandle { get; } = new();
|
|
|
|
private void Awake()
|
|
{
|
|
EnabledHandle.AddListener(OnEnabled);
|
|
}
|
|
private void OnEnabled(bool obj)
|
|
{
|
|
isEnabled = obj;
|
|
report = EnabledHandle.ToString();
|
|
}
|
|
[BIT]
|
|
private void Check()
|
|
{
|
|
isEnabled = EnabledHandle.Allow;
|
|
report = EnabledHandle.ToString();
|
|
}
|
|
}
|
|
}
|
|
|