备份CatanBuilding瘦身独立工程
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public abstract class ScratchCardMask : MonoBehaviour
|
||||
{
|
||||
//public Action<ScratchCardMask, float, bool> RevealProgressChanged;
|
||||
|
||||
public bool IsRevealed()
|
||||
{
|
||||
if (m_Threshold <= 0f) return true;
|
||||
return GetRevealProgress() >= m_Threshold;
|
||||
}
|
||||
public void SetThreshold(float threshold)
|
||||
{
|
||||
m_Threshold = threshold;
|
||||
}
|
||||
|
||||
[Header("Mask")]
|
||||
[Range(0f, 1.0f)]
|
||||
[SerializeField] protected float m_Threshold = 0.75f;
|
||||
[SerializeField] protected float m_AlphaThreshold = 0.5f;
|
||||
|
||||
public abstract float GetRevealProgress();
|
||||
|
||||
//protected void OnRevealProgressChanged()
|
||||
//{
|
||||
// float progress = 0f;
|
||||
// bool isRevealed = false;
|
||||
|
||||
// if (m_Threshold <= 0)
|
||||
// {
|
||||
// isRevealed = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// progress = GetRevealProgress();
|
||||
// isRevealed = progress >= m_Threshold;
|
||||
// }
|
||||
|
||||
// //RevealProgressChanged?.Invoke(this, progress, isRevealed);
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user