public void Initialize() { blaster = new Blaster(this); this.maxHealth = 10; this.Health = this.maxHealth; TimedActionManager.GetInstance().RegisterAction( () => { if (last_time + MovementSpeed <= Time.time) { // Holding key down last_time = Time.time; HandleGetKey(); } else { if (HandleGetKeyDown()) { // Looks like we moved. Reset the clock! last_time = Time.time; } } } , this, MovementPollRate ); }
public static Accessory createAccessory(AccessoryType type, TileEntity t) { Accessory a = null; switch (type) { case AccessoryType.Counting: a = new CountAccessory(t); break; case AccessoryType.Blaster: a = new Blaster(t); break; } return(a); }