void Start() { // Extra logging is enabled because, as of build 1159, there is a NEW bug with object ownership transfer // that is still causing players to not properly transfer ownership. Repro: a lot of players join a world an once with this pool debug._u_Log("[Slot] " + gameObject.name + " Start"); pool = transform.parent.GetComponent <SlotPool>(); dataObjects = new UdonSharpBehaviour[transform.childCount]; for (int i = 0; i < dataObjects.Length; i++) { dataObjects[i] = (UdonSharpBehaviour)(transform.GetChild(i).GetComponent(typeof(UdonSharpBehaviour))); } startFinished = true; // If you're the first person in the instance, dummy serialize once so buffered deserializations can be // counted by slots for all late joiners to know when full deserialization is complete. if (Networking.IsMaster) { bufferedDeserializationFinished = true; dataObjectsDeserializationFinished = true; pool._u_ReportBufferedDeserialization(); RequestSerialization(); } else { _u_TryReportBufferedDeserialization(); } }
public SlotFactory(GameObject tilePrefab, GameObject slotPrefab, SlotPool slotPool, SlotPool answerSlotPool) { _tilePrefab = tilePrefab; _slotPrefab = slotPrefab; _slotPool = slotPool; _answerSlotPool = answerSlotPool; }
public void SetSlotPools(SlotPool tileSlotPool, SlotPool answerSlotPool) { _tileSlotPool = tileSlotPool; _answerSlotPool = answerSlotPool; _currentSlotPool = _tileSlotPool; _nextSlotPool = _answerSlotPool; _currentSlotPool.AddToNextFreeSlot(this); }
protected void SwapCurrentSlotPool() { if(_nextSlotPool.IsFull()) return; _currentSlotPool.RemoveFromSlot(this); _nextSlotPool.AddToNextFreeSlot(this); SlotPool tempPool = _currentSlotPool; _currentSlotPool = _nextSlotPool; _nextSlotPool = tempPool; }
public void ListenTo(SlotPool slotPool) { slotPool.OnTileAdded += AddLetter; slotPool.OnTileRemoved += RemoveLetter;//need to unregister later }
void Awake() { Instance = this; }