Totem.SetOwner C# (CSharp) Method

SetOwner() private method

private SetOwner ( int ownerPlayerId ) : void
ownerPlayerId int
return void
    public void SetOwner(int ownerPlayerId)
    {
        Owner = ownerPlayerId;

        if (Network.isServer)
        {
            Cell = TerrainGrid.RegisterTotem(ownerPlayerId, this);
            if (Cell == null)
                throw new InvalidOperationException("Cell should be free at this time");
        }
        else
            // For word detection, needs to be done also on client side
            TerrainGrid.Instance.Totems[ownerPlayerId].Add(this);
    }