高级会员
- 积分
- 585
- 金钱
- 585
- 注册时间
- 2020-5-25
- 在线时间
- 42 小时
|
using UnityEngine;/*by Alexander*/public enum UserState{ Online, Chatting, Pushing, Offline}public class StateController : MonoBehaviour{ private object m_mutex = new object(); private bool m_initialized = false; private static StateController stateController = null; // Singleton in thread-safe-mode public StateController Instance { get { if (!this.m_initialized) { lock (this.m_mutex) { if (stateController == null) { stateController = new StateController(); m_initialized = true; } } } return stateController; } } private UserState m_state; public UserState State { get { return m_state; } set { lock (m_mutex) { m_state = value; } } }}
|
|