Пример #1
0
    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();
        }
    }
Пример #2
0
    public SlotFactory(GameObject tilePrefab, GameObject slotPrefab, SlotPool slotPool, SlotPool answerSlotPool)
    {
        _tilePrefab = tilePrefab;
        _slotPrefab = slotPrefab;

        _slotPool = slotPool;
        _answerSlotPool = answerSlotPool;
    }
Пример #3
0
    public void SetSlotPools(SlotPool tileSlotPool, SlotPool answerSlotPool)
    {
        _tileSlotPool = tileSlotPool;
        _answerSlotPool = answerSlotPool;

        _currentSlotPool = _tileSlotPool;
        _nextSlotPool = _answerSlotPool;

        _currentSlotPool.AddToNextFreeSlot(this);
    }
Пример #4
0
    protected void SwapCurrentSlotPool()
    {
        if(_nextSlotPool.IsFull())
            return;

        _currentSlotPool.RemoveFromSlot(this);
        _nextSlotPool.AddToNextFreeSlot(this);

        SlotPool tempPool = _currentSlotPool;
        _currentSlotPool = _nextSlotPool;
        _nextSlotPool = tempPool;
    }
Пример #5
0
 public void ListenTo(SlotPool slotPool)
 {
     slotPool.OnTileAdded += AddLetter;
     slotPool.OnTileRemoved += RemoveLetter;//need to unregister later
 }
Пример #6
0
 void Awake()
 {
     Instance = this;
 }