コード例 #1
0
 private static void Awake(Container __instance, ZNetView ___m_nview)
 {
     // if no ZNetView is present then we are dealing with a
     // placement ghost or some other thing, either we it's not a network
     // object for our purposes
     if (___m_nview == null || ___m_nview.GetZDO()?.m_uid == null ||
         // if we got no owning piece then there's also something wrong and
         // most likely this is something we don't want to track
         // currently known "Piece"less objects: tombstone
         !TryGetValidOwningPiece(___m_nview, out var piece))
     {
         Plugin.Log.LogDebug($"Will not track container {__instance.m_name} ({__instance.name}). ZNetView: {___m_nview.GetZDO()?.m_uid}.");
         return;
     }
     ContainerTracker.Add(__instance, ___m_nview, piece);
 }
コード例 #2
0
 private static void OnDestroyed(Container __instance)
 {
     Plugin.Log.LogDebug($"{__instance?.gameObject.name} is destroyed");
     ContainerTracker.Remove(__instance);
 }