public Rectf Clone() { Rectf clone = new Rectf(); clone.x = x; clone.y = y; clone.width = width; clone.height = height; return clone; }
public void LoadFrom(Stream stream) { BinaryReader reader = new BinaryReader(stream); m_Name = reader.ReadNameA4(); m_Rect = new Rectf(stream); m_Offset = reader.ReadVector2(); m_Border = reader.ReadVector4(); m_PixelsToUnits = reader.ReadSingle(); m_Extrude = reader.ReadUInt32(); m_RD = new SpriteRenderData(file, stream); }
public void LoadFrom(Stream stream) { BinaryReader reader = new BinaryReader(stream); texture = new PPtr<Texture2D>(stream, file); int numVertices = reader.ReadInt32(); vertices = new SpriteVertex[numVertices]; for (int i = 0; i < numVertices; i++) { vertices[i] = new SpriteVertex(stream); } int numIndices = reader.ReadInt32(); indices = reader.ReadUInt16Array(numIndices); if ((numIndices & 1) > 0) { reader.ReadBytes(2); } textureRect = new Rectf(stream); textureRectOffset = reader.ReadVector2(); settingsRaw = reader.ReadUInt32(); uvTransform = reader.ReadVector4(); }
public void LoadFrom(Stream stream) { BinaryReader reader = new BinaryReader(stream); m_GameObject = new PPtr<GameObject>(stream, file); m_Enabled = reader.ReadByte(); stream.Position += 3; m_ClearFlags = reader.ReadUInt32(); m_BackGroundColor = reader.ReadColor4(); m_NormalizedViewPortRect = new Rectf(stream); near_clip_plane = reader.ReadSingle(); far_clip_plane = reader.ReadSingle(); field_of_view = reader.ReadSingle(); orthographic = reader.ReadBoolean(); stream.Position += 3; orthographic_size = reader.ReadSingle(); m_Depth = reader.ReadSingle(); m_CullingMask = new BitField(stream); m_RenderingPath = reader.ReadInt32(); m_TargetTexture = new PPtr<Texture2D>(stream, file); m_TargetDisplay = reader.ReadUInt32(); m_HDR = reader.ReadBoolean(); m_OcclusionCulling = reader.ReadBoolean(); stream.Position += 2; m_StereoConvergence = reader.ReadSingle(); m_StereoSeparation = reader.ReadSingle(); }