Created
April 6, 2011 08:41
-
-
Save lucasmeijer/905342 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 { | |
import UnityEngine.MonoBehaviour; | |
import UnityEngine.Debug; | |
import UnityEngine.Vector3; | |
import UnityEngine.Time; | |
import UnityEngine.Serialization.IDeserializable; | |
import UnityEngine.Serialization.SerializedStateReader; | |
public class NewBehaviourScript extends MonoBehaviour implements IDeserializable { | |
public var speed: int; | |
public var myfloat: Number; | |
public var mystring: String; | |
public var anotherstring: String; | |
public function Start(): void { | |
Debug.Log("speed"); | |
Debug.Log(this.speed); | |
Debug.Log("float:"); | |
var num: int = (this.myfloat as int); | |
Debug.Log(num); | |
Debug.Log("string:"); | |
Debug.Log(this.mystring); | |
Debug.Log("anotherstring:"); | |
Debug.Log(this.anotherstring); | |
} | |
public function Update(): void { | |
super.transform.RotateAround(Vector3.up, Time.deltaTime * (this.speed as Number)); | |
} | |
public function Deserialize(reader: SerializedStateReader): void { | |
this.speed = reader.ReadInt(); | |
this.myfloat = reader.ReadFloat(); | |
this.mystring = reader.ReadString(); | |
this.anotherstring = reader.ReadString(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment