private void AddSyringe(CallbackData data) { //virhetilanteet: pieni ruisku yhdistetty ennen lääkkeellisen ruiskun laittamista GameObject g = data.DataObject as GameObject; GeneralItem item = g.GetComponent <GeneralItem>(); Syringe s = item.GetComponent <Syringe>(); if (s.Container.Capacity == RIGHT_SMALL_SYRINGE_CAPACITY) { usedSyringes.Add(s); Logger.Print("Added new syringe to used: " + usedSyringes.Count); } if (!attachedSyringes.ContainsKey(s.GetInstanceID()) && !s.hasBeenInBottle) { attachedSyringes.Add(s.GetInstanceID(), s.Container.Amount); } if (!IsPreviousTasksCompleted(requiredTasks)) { return; } else if (!laminarCabinet.GetContainedItems().Contains(s)) { CreateTaskMistake("Ruisku kiinnitettiin laminaarikaapin ulkopuolella", 1); attachedSyringes.Remove(s.GetInstanceID()); } else { base.package.MoveTaskToManager(this); } }
private void AddSyringe(CallbackData data) { GameObject g = data.DataObject as GameObject; GeneralItem item = g.GetComponent <GeneralItem>(); Syringe s = item.GetComponent <Syringe>(); if (s.Container.Capacity == 20000) { return; } if (!usedSyringes.ContainsKey(s)) { usedSyringes.Add(s, 0); } if (!attachedSyringes.ContainsKey(s.GetInstanceID()) && !s.hasBeenInBottle) { attachedSyringes.Add(s.GetInstanceID(), s.Container.Amount); } }