UnityEngine.Networking.ChannelPacket.IsEmpty C# (CSharp) 메소드

IsEmpty() 공개 메소드

public IsEmpty ( ) : bool
리턴 bool
        public bool IsEmpty()
        {
            return (this.m_Position == 0);
        }

Usage Example

예제 #1
0
        public bool SetOption(ChannelOption option, int value)
        {
            switch (option)
            {
            case ChannelOption.MaxPendingBuffers:
                if (!m_IsReliable)
                {
                    return(false);
                }
                if (value < 0 || value >= 512)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("Invalid MaxPendingBuffers for channel " + m_ChannelId + ". Must be greater than zero and less than " + 512);
                    }
                    return(false);
                }
                m_MaxPendingPacketCount = value;
                return(true);

            case ChannelOption.AllowFragmentation:
                m_AllowFragmentation = (value != 0);
                return(true);

            case ChannelOption.MaxPacketSize:
                if (!m_CurrentPacket.IsEmpty() || m_PendingPackets.Count > 0)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("Cannot set MaxPacketSize after sending data.");
                    }
                    return(false);
                }
                if (value <= 0)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("Cannot set MaxPacketSize less than one.");
                    }
                    return(false);
                }
                if (value > m_MaxPacketSize)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("Cannot set MaxPacketSize to greater than the existing maximum (" + m_MaxPacketSize + ").");
                    }
                    return(false);
                }
                m_CurrentPacket = new ChannelPacket(value, m_IsReliable);
                m_MaxPacketSize = value;
                return(true);

            default:
                return(false);
            }
        }
All Usage Examples Of UnityEngine.Networking.ChannelPacket::IsEmpty