public static PUN2ClientCollection <IItemInstance> CreateClientItemCollection(int slotCount, string collectionName, System.Guid collectionGuid, PhotonView owner, PUN2ActionsBridge playerBridge) { var collection = new PUN2ClientCollection <IItemInstance>(owner, playerBridge, slotCount) { collectionName = collectionName, ID = collectionGuid }; collection.Register(); // Set permission for this client; If we own it it will be added to the registry list. PUN2PermissionsRegistry.collections.SetPermission(collection, playerBridge.photonView, ReadWritePermission.None); _logger.Log($"[Client] Created and registered collection with name '{collection.collectionName}' and guid '{collection.ID}' for ViewID: {owner.ViewID}", collection); return(collection); }
public static PUN2ClientCollection <IVendorProduct <IItemInstance> > CreateClientVendorItemCollection(int slotCount, string collectionName, System.Guid collectionGuid, PhotonView owner, PUN2ActionsBridge playerBridge) { var collection = new PUN2ClientCollection <IVendorProduct <IItemInstance> >(owner, playerBridge, slotCount) { collectionName = collectionName, ID = collectionGuid }; collection.Register(); // NOTE: Do not give the player read+write access to the vendor collection; That way the client could set items directly into the vendor collection. PUN2PermissionsRegistry.collections.SetPermission(collection, owner, ReadWritePermission.Read); _logger.Log($"[Client] Created and registered vendor item collection with name '{collectionName}' and guid '{collectionGuid}' for ViewID: {owner.ViewID}", collection); return(collection); }