private void Awake() { photocopierState = PhotocopierState.Idle; registerObject = gameObject.GetComponent <RegisterObject>(); printer = new Internal.Printer(0, trayCapacity, false); scanner = new Internal.Scanner(false, true, null, null); }
public void ServerPerformInteraction(HandApply interaction) { if (interaction.HandObject == null) { if (printer.TrayOpen) { Chat.AddExamineMsgFromServer(interaction.Performer, "You close the tray."); ToggleTray(); } else if (scanner.ScannerOpen) { Chat.AddExamineMsgFromServer(interaction.Performer, "You close the scanner lid."); ToggleScannerLid(); } else { OnGuiRenderRequired(); TabUpdateMessage.Send(interaction.Performer, gameObject, NetTabType, TabAction.Open); } } else if (printer.CanAddPageToTray(interaction.HandObject)) { printer = printer.AddPageToTray(interaction.HandObject); Chat.AddExamineMsgFromServer(interaction.Performer, "You place the sheet in the tray."); } else if (scanner.CanPlaceDocument(interaction.HandObject)) { scanner = scanner.PlaceDocument(interaction.HandObject); Chat.AddExamineMsgFromServer(interaction.Performer, "You place the document in the scanner."); } }
private IEnumerator WaitForPrint() { yield return(WaitFor.Seconds(4f)); SyncPhotocopierState(PhotocopierState.Idle); printer = printer.Print(scanner.ScannedText, gameObject, photocopierState == PhotocopierState.Idle, paperPrefab); OnGuiRenderRequired(); }
public void ToggleTray() { printer = printer.ToggleTray(); OnGuiRenderRequired(); }
public static void WritePrinter(this NetworkWriter writer, Printer printer) { writer.Write(printer.TrayCount); writer.Write(printer.TrayCapacity); writer.WriteBool(printer.TrayOpen); }