BitHelper.getBytes C# (CSharp) Method

getBytes() public static method

public static getBytes ( Color32 color ) : byte[]
color Color32
return byte[]
    public static byte[] getBytes(Color32 color)
    {
        byte[] buf = new byte[4];
        buf[0] = color.a;
        buf[1] = color.r;
        buf[2] = color.g;
        buf[3] = color.b;
        return buf;
    }
    public static Color32 ToColor32(byte[] buf, int pos)

Same methods

BitHelper::getBytes ( Bounds, bound ) : byte[]
BitHelper::getBytes ( Quaternion, pos ) : byte[]
BitHelper::getBytes ( Vector2 pos ) : byte[]
BitHelper::getBytes ( Vector3 pos ) : byte[]
BitHelper::getBytes ( Vector4 pos ) : byte[]
BitHelper::getBytes ( string str ) : byte[]

Usage Example

コード例 #1
0
ファイル: BoneMatrix.cs プロジェクト: liro0206/EgretUnity
 public void Save(System.IO.Stream stream, PoseBoneMatrix last)
 {
     byte[] btag = new byte[2];
     btag[0] = (byte)tag;
     btag[1] = last == null ? (byte)(PoseBoneMatrix.changetag.All) : (byte)tag;
     stream.Write(btag, 0, 2);
     if (last == null || (tag & PoseBoneMatrix.changetag.Rotate) > 0)
     {
         byte[] buf = BitHelper.getBytes(r);
         stream.Write(buf, 0, 16);
     }
     if (last == null || (tag & PoseBoneMatrix.changetag.Trans) > 0)
     {
         byte[] buf = BitHelper.getBytes(t);
         stream.Write(buf, 0, 12);
     }
     if (last == null || (tag & PoseBoneMatrix.changetag.Scale) > 0)
     {
         byte[] buf = BitHelper.getBytes(s);
         stream.Write(buf, 0, 12);
     }
 }
All Usage Examples Of BitHelper::getBytes