12345678910111213141516171819202122232425262728293031 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [ExecuteInEditMode]
- public abstract class SCUI3D : MonoBehaviour
- {
- protected bool isDirty = false;
- protected virtual void Awake()
- {
- MarkUIDirty();
- }
- protected virtual void Update()
- {
- if (!isDirty)
- {
- return;
- }
- isDirty = false;
- RebuildUI();
- }
- public virtual void MarkUIDirty()
- {
- isDirty = true;
- }
- public abstract void RebuildUI();
- }
|