void Update() { if (Input.GetKeyDown(KeyCode.O)) { IRobotPart robot = new Robot(); robot.Accept(new RobotPartActivateVisitor()); } if (Input.GetKeyDown(KeyCode.S)) { IRobotPart robot = new Robot(); robot.Accept(new RobotPartShutdownVisitor()); } }
private void TurnOn() { var turnOn = new TurnOnVisitor(); robot.Accept(turnOn); }