BBGamelib.flash.imp.PlaceObject.PlaceObject C# (CSharp) Method

PlaceObject() public method

public PlaceObject ( byte data, Cursor cursor ) : UnityEngine
data byte
cursor Cursor
return UnityEngine
		public PlaceObject(byte[] data, Cursor cursor){
			int dataLength = Utils.ReadInt32 (data, cursor);
			int nextIndex = cursor.index + dataLength;
			
			//parse
			hasMatrix = Utils.ReadByte (data, cursor) == 0 ? false : true;
			hasCharacter = Utils.ReadByte (data, cursor) == 0 ? false : true;
			hasColorTransform = Utils.ReadByte (data, cursor) == 0 ? false : true;
			isHidden = Utils.ReadByte (data, cursor) == 0 ? false : true;
			
			depth = Utils.ReadInt32(data, cursor);
			characterId = Utils.ReadInt32 (data, cursor);
			if (hasMatrix) {
				position = Utils.ReadVector2(data, cursor);
				rotation = Utils.ReadFloat(data, cursor);
				scaleX = Utils.ReadFloat(data, cursor);
				scaleY = Utils.ReadFloat(data, cursor);
			}else{
				position = Vector2.zero;
				rotation = 0;
				scaleX = 1;
				scaleY = 1;
			}


			if(hasColorTransform)
				colorTransform = Utils.ReadColorTransform(data, cursor);
			else
				colorTransform = new ColorTransform(Color.white, Color.black);
			instanceName = Utils.ReadString(data, cursor);
			
			cursor.index = nextIndex;
		}