public void ComponentDeserialize(Component cmp, BinaryNode node)
    {
        SphereCollider sphereCollider = cmp as SphereCollider;

        sphereCollider.center    = UnityBasetypeSerializer.BytesToVector3(GameSerializer.GetBinaryAttribute(node, "center"));
        sphereCollider.radius    = UnityBasetypeSerializer.BytesToFloat(GameSerializer.GetBinaryAttribute(node, "radius"));
        sphereCollider.isTrigger = bool.Parse(GameSerializer.GetAttribute(node, "trigger"));
    }
Exemplo n.º 2
0
    public void ObjectDeserialize(ref object o, BinaryNode node)
    {
        byte[] binaryAttribute = GameSerializer.GetBinaryAttribute(node, "Value");
        Color  color           = (Color)o;

        UnityBasetypeSerializer.BytesToColor(ref color, binaryAttribute);
        o = color;
    }
Exemplo n.º 3
0
    public void ObjectDeserialize(ref object o, BinaryNode node)
    {
        byte[]    binaryAttribute = GameSerializer.GetBinaryAttribute(node, "Value");
        Matrix4x4 matrix          = (Matrix4x4)o;

        UnityBasetypeSerializer.BytesToMatrix4x4(ref matrix, binaryAttribute);
        o = matrix;
    }
Exemplo n.º 4
0
    public void ObjectDeserialize(ref object o, BinaryNode node)
    {
        byte[]  binaryAttribute = GameSerializer.GetBinaryAttribute(node, "Value");
        Vector2 vector          = default(Vector2);

        UnityBasetypeSerializer.BytesToVector2(ref vector, binaryAttribute);
        o = vector;
    }
Exemplo n.º 5
0
    public void ObjectDeserialize(ref object o, BinaryNode node)
    {
        byte[]     binaryAttribute = GameSerializer.GetBinaryAttribute(node, "Value");
        Quaternion quaternion      = (Quaternion)o;

        UnityBasetypeSerializer.BytesToQuaternion(ref quaternion, binaryAttribute);
        o = quaternion;
    }
    public void ComponentDeserialize(Component cmp, BinaryNode node)
    {
        BoxCollider collider = cmp as BoxCollider;

        collider.center    = UnityBasetypeSerializer.BytesToVector3(GameSerializer.GetBinaryAttribute(node, "center"));
        collider.size      = UnityBasetypeSerializer.BytesToVector3(GameSerializer.GetBinaryAttribute(node, "size"));
        collider.isTrigger = bool.Parse(GameSerializer.GetAttribute(node, "trigger"));
    }
Exemplo n.º 7
0
    public void ObjectDeserialize(ref object o, BinaryNode node)
    {
        byte[] binaryAttribute = GameSerializer.GetBinaryAttribute(node, "Value");
        Rect   rect            = (Rect)o;

        UnityBasetypeSerializer.BytesToRect(ref rect, binaryAttribute);
        o = rect;
    }
Exemplo n.º 8
0
    public void ObjectDeserialize(ref object o, BinaryNode node)
    {
        byte[] binaryAttribute = GameSerializer.GetBinaryAttribute(node, "Value");
        Bounds bounds          = (Bounds)o;

        UnityBasetypeSerializer.BytesToBounds(ref bounds, binaryAttribute);
        o = bounds;
    }
    public void ComponentDeserialize(Component cmp, BinaryNode node)
    {
        CapsuleCollider capsuleCollider = cmp as CapsuleCollider;

        capsuleCollider.center    = UnityBasetypeSerializer.BytesToVector3(GameSerializer.GetBinaryAttribute(node, "center"));
        capsuleCollider.radius    = UnityBasetypeSerializer.BytesToFloat(GameSerializer.GetBinaryAttribute(node, "radius"));
        capsuleCollider.height    = UnityBasetypeSerializer.BytesToFloat(GameSerializer.GetBinaryAttribute(node, "height"));
        capsuleCollider.direction = UnityBasetypeSerializer.BytesToInt(GameSerializer.GetBinaryAttribute(node, "dir"));
        capsuleCollider.isTrigger = bool.Parse(GameSerializer.GetAttribute(node, "trigger"));
    }