private void DropZone_ObjectEnteredSnapDropZone(object sender, SnapDropZoneEventArgs e) { if (e.snappedObject.tag == "Tile" && ObjectEnteredDropZone == null) { ObjectEnteredDropZone = e.snappedObject; } }
protected void DestroyMed(object sender, SnapDropZoneEventArgs e) { bool correctPatient = false; if (Tracker.patient.Equals(this.transform.parent.parent.gameObject.GetComponent <PatientPerson>().patient)) { Tracker.interactedWithCorrectPatient = true; correctPatient = true; } else { Tracker.wrongPatient++; } foreach (Transform child in this.transform) { if (child.tag == TAG) { if (correctPatient && child.gameObject.GetComponent <MedicineData>().medicine.Equals(Tracker.medicine)) { Tracker.correctMedicineGiven = true; //if correctPatient and correct medicine Tracker.quantityApplied++; } Destroy(child.gameObject); } } }
protected virtual void UntoggleZoneB(object sender, SnapDropZoneEventArgs e) { if (toggleZoneB.GetCurrentSnappedObject() == null) { toggleZoneA.gameObject.SetActive(true); } }
public void OnObjectSnapped(object sender, SnapDropZoneEventArgs e) { TableData d = (TableData)data.data.GetValue(); VRTK_SnapDropZone dropZone = ((VRTK_SnapDropZone)sender); SceneGameObjectReference sor = new SceneGameObjectReference(e.snappedObject.gameObject.GetComponentInChildren <SceneGameObject>()); if (dropZone.gameObject.name == "slot00") { d.slot00 = sor; } if (dropZone.gameObject.name == "slot01") { d.slot01 = sor; } if (dropZone.gameObject.name == "slot02") { d.slot02 = sor; } if (dropZone.gameObject.name == "slot03") { d.slot03 = sor; } if (dropZone.gameObject.name == "slot04") { d.slot04 = sor; } data.data.SetValue(d); }
public override void OnObjectUnsnappedFromDropZone(SnapDropZoneEventArgs e) { base.OnObjectUnsnappedFromDropZone(e); Burner burner = transform.parent.GetComponent <Burner>(); burner.lidIsOn = false; }
private void SnapZone_ObjectSnappedToDropZone(object sender, SnapDropZoneEventArgs e) { isWallCableConnected = true; Debug.Log("Cable Connected to Wall!"); cableToWall = e.snappedObject.transform.parent; CheckIsSetUp(); }
internal void OnPieceSnapped(object sender, SnapDropZoneEventArgs e) { if (!isCorrectlyFinished) { currentPieces++; string objectName = e.snappedObject.name; string zoneName = sender.ToString(); if (PieceIsCorrect(objectName, zoneName)) { correctPieces++; if (correctPieces == MAX_PIECES) { isCorrectlyFinished = true; ChangeBulbColor(LightGreen); LockAllPiecesInPlace(); gameManagerScript.PaintingFinished(); } } if (currentPieces == MAX_PIECES && !isCorrectlyFinished) { ChangeBulbColor(LightRed); } } }
void DiskUnsnappedFromDropZone(object sender, SnapDropZoneEventArgs e) { disk = null; playing = false; audioSource.Stop(); Debug.Log("Unsnap"); }
private void DoSphereZoneUnsnapped(object sender, SnapDropZoneEventArgs e) { if (sphereZone.GetCurrentSnappedObject() == null) { cubeZone.gameObject.SetActive(true); } }
private void ObjectSnappedInto(object sender, SnapDropZoneEventArgs e) { TextBlock block = dropZone.GetCurrentSnappedObject().GetComponent <TextBlock>(); if (block != null && block.id == typeInfos[infoIndex].id) { Debug.Log("Correct"); backgroundRenderer.material.color = Color.green; infoIndex++; //Check index if (infoIndex > typeInfos.Length - 1) { infoIndex = 0; } variable1.text = typeInfos[infoIndex].var1.ToString(); variable2.text = typeInfos[infoIndex].var2.ToString(); Invoke("ColorBack", 1f); } else { Debug.Log("How dare you make such a mistake"); backgroundRenderer.material.color = Color.red; Invoke("ColorBack", 1f); } }
// when item is snapped to inventory private void ItemSnapped(object sender, SnapDropZoneEventArgs e) { foreach (Transform child in this.transform) { if (child.GetComponent <RotationVectorInventory>()) { child.Rotate(child.GetComponent <RotationVectorInventory>().rotationInInventory); } //{ //// Item is tablet //if (child.name.Contains("realTablet")) //{ // Debug.Log("Found tablet: " + child.name); // child.Rotate(new Vector3(-90, 90, 0)); //} //else if (child.name.Contains("Syringe")) //{ // child.Rotate(new Vector3(0, 0, -90)); //} //else if (child.name.Contains("Cup") || child.name.Contains("Badge")) //{ // child.Rotate(new Vector3(-90, 0, 0)); //} //} } }
private void DoCubeZoneSnapped(object sender, SnapDropZoneEventArgs e) { if (sphereZone.GetCurrentSnappedObject() == null) { sphereZone.gameObject.SetActive(false); } }
private void ModemInstallationManager_ObjectSnappedToDropZone(object sender, SnapDropZoneEventArgs e) { isModemCableConnected = true; Debug.Log("Cable Connected to Modem!"); cableToModem = e.snappedObject.GetComponent <VRTK_InteractableObject>()?.GetPreviousParent; CheckIsSetUp(); }
private void OnTrashUnsnapped(object sender, SnapDropZoneEventArgs e) { if (e.snappedObject.tag == TRASH_TAG) { trashCounter--; } }
private void ObjectSnappedToDropZone(object sender, SnapDropZoneEventArgs e) { for (int i = 0; i < chaiseSnapDropZones.Length; i++) { chaiseSnapDropZones[i].GetComponent <VRTK_SnapDropZone>().highlightAlwaysActive = false; } }
public override void OnObjectEnteredSnapDropZone(SnapDropZoneEventArgs e) { base.OnObjectEnteredSnapDropZone(e); Door.GetComponent <VRTK_InteractableObject>().isGrabbable = true; Door.GetComponent <Rigidbody>().isKinematic = false; GameController.instance.timerStarted = true; }
public override void OnObjectSnappedToDropZone(SnapDropZoneEventArgs e) { base.OnObjectSnappedToDropZone(e); Burner burner = transform.parent.GetComponent <Burner>(); burner.PutOutFire(); burner.lidIsOn = true; }
private void DropZone_ObjectSnappedToDropZone(object sender, SnapDropZoneEventArgs e) { zoneID = e.snappedObject.GetComponent <TextBlock>().id; snappedObject = e.snappedObject; CheckInsert(e.snappedObject); }
private void MinusSnapCount(object sender, SnapDropZoneEventArgs e) { if (NumofSnapped == SnapZones.Length) { Destroy(GetComponent <CollectableObject_Basic>()); } NumofSnapped--; CheckSnapStatus(); }
private void DoProgramBlockZoneExited(object sender, SnapDropZoneEventArgs e) { Debug.Log("== SnapDropZone: EXITED >>>>"); if (sender is VRTK_SnapDropZone) { VRTK_SnapDropZone originZone = (VRTK_SnapDropZone)sender; DecreaseZoneHeight(originZone.GetComponent <SnapDropZone>().ZoneId); } }
public override void OnObjectSnappedToDropZone(SnapDropZoneEventArgs e) { base.OnObjectSnappedToDropZone(e); AirTransmit air = transform.parent.GetComponent <AirTransmit>(); AirTransmit.Connect(air, e.snappedObject.GetComponent <AirTransmit>()); TipBoard.Progress(0, 0); TipBoard.Progress(1, 5); }
private void OnUnsnap(object sender, SnapDropZoneEventArgs e) { if (requireCredits != null) { requireCredits.Increment(-1); } SetSnapDropZoneActive(false); e.snappedObject.layer = normalLayer; }
internal void OnKeySnapped(object sender, SnapDropZoneEventArgs e) { if (e.snappedObject.tag == KEY_TAG) { if (doorTeletransporterScript != null) { doorTeletransporterScript.Enable(); } } }
private void ModemInstallationManager_ObjectUnsnappedFromDropZone(object sender, SnapDropZoneEventArgs e) { isModemCableConnected = false; Debug.Log("Cable Disonnected from Modem!"); if (DisplayCorotine != null && isCoroutineRuning) { StopCoroutine(DisplayCorotine); } ResetDisplay(); cableToModem = null; }
private void SnapZone_ObjectUnsnappedFromDropZone(object sender, SnapDropZoneEventArgs e) { isWallCableConnected = false; Debug.Log("Cable Disconnected from Wall!"); if (DisplayCorotine != null && isCoroutineRuning) { StopCoroutine(DisplayCorotine); } ResetDisplay(); cableToWall = null; }
protected void IVHandConnected(object sender, SnapDropZoneEventArgs e) { if (Tracker.patient == this.transform.parent.parent.gameObject.GetComponent <PatientPerson>().patient) { Tracker.interactedWithCorrectPatient = true; } else { Tracker.wrongPatient++; } }
private void VRTK_SnapDropZone_ObjectSnappedToDropZone(object sender, SnapDropZoneEventArgs e) { Debug.Log("ObjectSnappedToDropZone"); GameObject obj = e.snappedObject; if (obj.tag == "ShellCasing") { isShellCasingSnapped = true; shellCasing = obj; } }
private void CheckSnappedObject(object sender, SnapDropZoneEventArgs e) { if (e.snappedObject == correctObjectToSnap) { if (correctObjectSnapped != null) { Debug.Log("Correct Pipe inserted."); correctObjectSnapped.Invoke(); } } }
private void SnapZone_ObjectSnappedToDropZone(object sender, SnapDropZoneEventArgs e) { if (e.snappedObject.name == "Start") { e.snappedObject.transform.Rotate(0, -90, 0); } else if (e.snappedObject.name == "End") { e.snappedObject.transform.Rotate(0, 90, 0); } }
private void Zones_ObjectExitedSnapDropZone(object sender, SnapDropZoneEventArgs e) { //Debug.Log(e.snappedObject.ge); Debug.Log(sender.ToString()); int blockIndex = int.Parse(sender.ToString()); //Debug.Log("Value of snapped block" + snapZones[blockIndex].defaultSnappedInteractableObject.transform.GetComponent<TextBlock>().text); //int blockIndex = int.Parse(sender.ToString()); //textBlocks[blockIndex].text = blockinfos[blockIndex].text; //textBlocks[blockIndex].id = blockinfos[blockIndex].id; }