ScribblerHolder.GetFreeDropPosition C# (CSharp) Method

GetFreeDropPosition() public method

public GetFreeDropPosition ( ) : DropPosition
return DropPosition
    public DropPosition GetFreeDropPosition()
    {
        foreach (var position in dropPositions)
        {
            if (!position.inUse)
            {
                position.inUse = true;
                return position;
            }
        }

        return null;
    }

Usage Example

Esempio n. 1
0
    public override bool OffInteract(GazePointer pointer, Transform objectToInteractWith)
    {
        if (objectToInteractWith)
        {
            holder = objectToInteractWith.GetComponent<ScribblerHolder>();

            if (holder)
            {
                holder.puzzle.PutInHolder(this, holder);

                dropPosition = holder.GetFreeDropPosition();
            }
        }
        else
        {
            Debug.Log("objectToInteractWith is null");
            holder = null;
        }

        return base.OffInteract(pointer, objectToInteractWith);
    }
All Usage Examples Of ScribblerHolder::GetFreeDropPosition