protected override void OnTaskComplete() { return; CabinetBase cabinet = null; foreach (CabinetBase c in GameObject.FindObjectsOfType <CabinetBase>()) { if (c.type == CabinetBase.CabinetType.Laminar) { cabinet = c; } } foreach (Interactable interactable in cabinet.GetContainedItems()) { GeneralItem g = interactable as GeneralItem; if (g != null && !g.IsClean) { Logger.Warning("Possibly deprecated minus disinfect bottle"); CreateTaskMistake("Pullon korkkia ei puhdistettu", 1); return; } } }
/// <summary> /// Teleports player and Contents of Pass-Through cabinet to the next room. /// </summary> public void TeleportPlayerAndPassthroughCabinet() { if (playerDst == null || passthroughDst == null) { Logger.Print("Cannot teleport without references to teleportation spots!"); return; } CabinetBase cabinet = passthroughSrc.GetComponent <CabinetBase>(); List <Transform> items = cabinet.GetContainedItems().ConvertAll(obj => obj.transform); foreach (Transform item in items) { float rotDelta = Quaternion.Angle(passthroughSrc.rotation, passthroughDst.rotation); item.position = passthroughDst.position + (item.position - passthroughSrc.position); item.RotateAround(passthroughDst.position, passthroughDst.up, rotDelta); CreateSpawner(item); } foreach (VRHandControls h in VRInput.Hands) { h.Hand.GrabUninteract(); h.Hand.Uninteract(); } player.position = playerDst.position; MedicinePreparationScene m = G.Instance.Scene as MedicinePreparationScene; if (!m.Restarted || MedicinePreparationScene.SavedScoreState == null) { m.SaveProgress(); } }
private void SetCabinetReference(CallbackData data) { CabinetBase cabinet = (CabinetBase)data.DataObject; if (cabinet.type == CabinetBase.CabinetType.Laminar) { laminarCabinet = cabinet; base.UnsubscribeEvent(SetCabinetReference, EventType.ItemPlacedForReference); } }
private void SetCabinetReference(CallbackData data) { CabinetBase cabinet = (CabinetBase)data.DataObject; if (cabinet.type == CabinetBase.CabinetType.PassThrough) { this.cabinet = cabinet; door = cabinet.transform.Find("Door").GetComponent <OpenableDoor>(); base.UnsubscribeEvent(SetCabinetReference, EventType.ItemPlacedForReference); } }