예제 #1
0
        public void TestStart()
        {
            try
            {
                LightObject lightObject = new LightObject();

                LightObject dummy = new LightObject();
                dummy.PutInt(1, 1000);
                dummy.PutInt(2, 10);

                LightObject dummy2 = new LightObject();
                dummy2.PutInt(1, 1000);
                dummy2.PutInt(2, 10);

                dummy.PutObject(1, dummy2);

                lightObject.PutObject(2, dummy);
                lightObject.PutObject(3, dummy2);

                byte[] data = lightObject.Serialize();

                LightObject coveredObject = LightObject.Deserialize(data);

                coveredObject.GetInt(1);

                Debugs.Log(coveredObject);
            }
            catch (Exception e)
            {
                Debugs.Log(e);
            }
        }
예제 #2
0
        public LightObject Serialize()
        {
            LightObject sendObj = new LightObject();

            sendObj.PutInt(0, seq);
            sendObj.PutInt(1, (int)eProtocolType);
            WriteLightObject();
            return(sendObj);
        }