Beispiel #1
0
 /// <summary>
 /// 禁用脚本的时候触发
 /// </summary>
 void OnDisable()
 {
     if (mCurrentLoom == this)
     {
         mCurrentLoom = null;
     }
 }
Beispiel #2
0
        static void Initialize()
        {
            if (false == initialized)
            {
                initialized = true;

                // monobehavior单例模式的写法
                var loomgameobject = new GameObject("Loom");
                mCurrentLoom = loomgameobject.AddComponent <UtilTreadLoom>();
            }
        }
Beispiel #3
0
 void Awake()
 {
     mCurrentLoom = this;
     initialized  = true;
 }