1
This commit is contained in:
37
Src/Unity/Pool/PoolObject.cs
Normal file
37
Src/Unity/Pool/PoolObject.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user