public void update(IDoor obj) { if (obj.getControllerType() != DoorControllerType.Standalone) return; if(CrossPlatformInputManager.GetButtonDown("Use")){ switch(obj.getState()){ case DoorState.Closed: obj.openDoor(); break; case DoorState.Locked: break; case DoorState.Opened: obj.closeDoor(); break; } } }
public void printLabel(IDoor doorObject) { onResizeWindow(); if (doorObject.getTextDisplayed() == TextDisplayed.None) return; GUI.Label(objectTitleRectangle,"["+doorObject.getName()+"]\n",titleStyle); GUI.Label(objectCaptionRectangle,doorObject.getCaption(),captionStyle); switch(doorObject.getState()){ case DoorState.Opened: doorStateStyle.normal.textColor = stateOpenedColor; break; case DoorState.Closed: doorStateStyle.normal.textColor = stateClosedColor; break; case DoorState.Locked: doorStateStyle.normal.textColor = stateLockedColor; break; } GUI.Label(objectStateRectangle,stateToString(doorObject.getState()),doorStateStyle); }