Created
April 4, 2011 22:06
-
-
Save bamboo/902563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package UnityEngine.Serialization { | |
class ActionScriptDeserializer { | |
public static function Deserialize(instance: IDeserializable, buffer: ByteArray, offset: int): int { | |
var reader = new SerializedStateReader(buffer, offset); | |
instance.Deserialize(reader); | |
return reader.offset; | |
} | |
} | |
interface IDeserializable { | |
function Deserialize(state: SerializedStateReader): void | |
} | |
class SerializedStateReader { | |
public function ReadFloat(): Number { | |
return ... | |
} | |
public function ReadInt(): int { | |
return ... | |
} | |
} | |
} | |
class Foo extends MonoBehaviour implements IDeserializable { | |
public var i : int; | |
function Deserialize(reader: SerializedStateReader) { | |
i = reader.ReadInt(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment