/// <summary> /// /// </summary> /// <param name="bytes"></param> public void OnMessageEventPull(BinaryReader binaryReader) { var textureKunPacket = new TextureKunPacket(); textureKunPacket.Deserialize(binaryReader); if (textureKunPacket.isScene) { GetAllTextureInScene(); } if (textureKunPacket.isResources) { GetAllTextureInResources(); } var textureKuns = new TextureKun[textureDict.Count]; var i = 0; foreach (var texture in textureDict.Values) { textureKuns[i++] = new TextureKun(texture); } textureKunPacket = new TextureKunPacket(textureKuns); UnityChoseKunPlayer.SendMessage <TextureKunPacket>(UnityChoseKun.MessageID.TexturePull, textureKunPacket); }
public Property() { dirty = false; m_colorValue = new ColorKun(); m_textureValue = new TextureKun(); m_vectorValue = new Vector4Kun(); m_scale = new Vector2Kun(); m_offset = new Vector2Kun(); }
/// <summary> /// Deserialize /// </summary> /// <param name="binaryReader">BinaryReader</param> public virtual void Deserialize(BinaryReader binaryReader) { m_isResources = binaryReader.ReadBoolean(); m_isScene = binaryReader.ReadBoolean(); var len = binaryReader.ReadInt32(); if (len != -1) { m_textureKuns = new TextureKun[len]; for (var i = 0; i < len; i++) { m_textureKuns[i] = new TextureKun(); m_textureKuns[i].Deserialize(binaryReader); } } }
public virtual void Deserialize(BinaryReader binaryReader) { #if UNITY_2019_1_OR_NEWER m_flags = (UnityEngine.Rendering.ShaderPropertyFlags)binaryReader.ReadInt32(); m_type = (UnityEngine.Rendering.ShaderPropertyType)binaryReader.ReadInt32(); #endif m_textureDimension = (UnityEngine.Rendering.TextureDimension)binaryReader.ReadInt32(); m_dirty = binaryReader.ReadBoolean(); m_nameId = binaryReader.ReadInt32(); m_floatValue = binaryReader.ReadSingle(); m_displayName = binaryReader.ReadString(); m_name = binaryReader.ReadString(); m_colorValue = SerializerKun.DesirializeObject <ColorKun>(binaryReader); m_textureValue = SerializerKun.DesirializeObject <TextureKun>(binaryReader); m_rangeLimits = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader); m_scale = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader); m_offset = SerializerKun.DesirializeObject <Vector2Kun>(binaryReader); m_vectorValue = SerializerKun.DesirializeObject <Vector4Kun>(binaryReader); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { var other = obj as TextureKunPacket; if (other == null) { return(false); } if (!m_isResources.Equals(other.m_isResources)) { return(false); } if (!m_isScene.Equals(other.m_isScene)) { return(false); } if (m_textureKuns != null) { if (other.m_textureKuns == null) { return(false); } if (m_textureKuns.Length != other.m_textureKuns.Length) { return(false); } for (var i = 0; i < m_textureKuns.Length; i++) { if (!TextureKun.Equals(m_textureKuns[i], other.m_textureKuns[i])) { return(false); } } } else if (other.m_textureKuns != null) { return(false); } return(true); }
public override bool Equals(object obj) { var other = obj as Property; if (other == null) { return(false); } #if UNITY_2019_1_OR_NEWER if (flags.Equals(other.flags) == false) { return(false); } if (type.Equals(other.type) == false) { return(false); } #endif if (dirty.Equals(other.dirty) == false) { return(false); } if (!ColorKun.Equals(m_colorValue, other.m_colorValue)) { return(false); } if (!string.Equals(displayName, other.displayName)) { return(false); } if (floatValue.Equals(other.floatValue) == false) { return(false); } if (!string.Equals(name, other.name)) { return(false); } if (nameId.Equals(other.nameId) == false) { return(false); } if (!Vector2Kun.Equals(m_rangeLimits, other.m_rangeLimits)) { return(false); } if (textureDimension.Equals(other.textureDimension) == false) { return(false); } if (!TextureKun.Equals(m_textureValue, other.m_textureValue)) { return(false); } if (!Vector4Kun.Equals(m_vectorValue, other.m_vectorValue)) { return(false); } if (!Vector2Kun.Equals(m_scale, other.m_scale)) { return(false); } if (!Vector2Kun.Equals(m_offset, other.m_offset)) { return(false); } return(true); }
/// <summary> /// /// </summary> /// <param name="textureKun"></param> public TextureView(TextureKun textureKun) { this.textureKun = textureKun; }