コード例 #1
0
 public void SetResourceState(ResourceState newResState)
 {
     if (null != newResState)
     {
         newResState.AddRef();
     }
     if (null != resState)
     {
         resState.SubRef();
     }
     resState = newResState;
 }
コード例 #2
0
        public static void Add(GameObject go, ResourceState resState)
        {
            resState.AddRef();
            GameObjectRefMonitorMono cmp = go.GetComponent <GameObjectRefMonitorMono>();

            if (null == cmp)
            {
                cmp = go.AddComponent <GameObjectRefMonitorMono>();
            }
            if (null != cmp.resState)
            {
                cmp.resState.SubRef();
            }
            cmp.resState = resState;
        }