public override void Interract(Tool.ToolType heldTool, float deltaTime) { if (Tutorial) { } if (heldTool == Tool.ToolType.Wrench) { health += repairSpeed * Time.deltaTime; if (health > 200f) { Working = true; health = 200f; healthBar.GetComponent <SpriteRenderer>().color = Color.green; } Vector2 scale = healthBar.transform.localScale; scale.x = health / 100; healthBar.transform.localScale = scale; } else if (heldTool == Tool.ToolType.FireExtinguisher) { fireState -= exstinguishSpeed * Time.deltaTime; if (fireState < 0f) { fireState = 0f; OnFire = false; Fire.SetActive(false); } } }
private void OnToolPickedUpTutorial(Tool.ToolType type, int playerNum) { if (type == ToolType.BUCKET) { bucketHeldTutorial = true; } }
private void OnToolDroppedTutorial(Tool.ToolType type, int playerNum) { if (type == ToolType.BUCKET) { bucketHeldTutorial = false; } }
public void OnInteractionBy(Hand hand, Tool.ToolType toolType) { if (interactDelegate != null) { interactDelegate(this, hand, toolType); } }
private void OnToolDropped(Tool.ToolType type, int playerNum) { if (panel_type == TutorialEventController.TutorialStates.PICK_UP_TOOL_GO_TO_PATIENT && type != Tool.ToolType.DEFIBULATOR) { RemovePlayerCircle(playerNum); } }
public void InformToolDropped(Tool.ToolType type, bool full) { if (type == Tool.ToolType.CANISTER) { if (onToolDroppedCanister != null) { onToolDroppedCanister(0); } } else if ((currentIndexInReciepe != -1) && (type == RequiredToolForReciepeState(scene1ReciepeElements[currentIndexInReciepe]))) { if (onToolDroppedForSurgery != null) { onToolDroppedForSurgery(type); } } else if (type == Tool.ToolType.BUCKET) { onBucketDropped(full); } else { if (onToolDroppedGeneral != null) { onToolDroppedGeneral(type); } } }
private void EnteringUpdate() { var t = getT(timeLastState, timeToEnter); if (t >= 1.0) { current_state = StepCompletePanelState.SHOWING; timeLastState = Time.time; if (panel_type == TutorialEventController.TutorialStates.PICK_UP_TOOL_GO_TO_PATIENT) { for (int i = 0; i < TutorialEventController.Instance.playerHasTool.Length; ++i) { Tool.ToolType type = TutorialEventController.Instance.playerHasTool[i]; bool atPatient = TutorialEventController.Instance.doctorAtPatient[i]; if (atPatient) { AddPlayerCircle(i, type, true); } else if (type != Tool.ToolType.NONE) { AddPlayerCircle(i, type, false); } } } } Vector3 newPos = Mathfx.Hermite(startPos, rect3posOrig, t); rectTrans.position = newPos; }
private void OnToolPickedUp(Tool.ToolType type, int playerNum) { if (tutorialToopPickUp) { actionButtonCanvas.SetActive(true); } }
public override void Interract(Tool.ToolType heldTool, float deltaTime) { if (heldTool == Tool.ToolType.FireExtinguisher) { Health += 50f * deltaTime; } }
private void OnInteraction(Interactable interactable, Hand hand, Tool.ToolType toolType) { if (toolType == Tool.ToolType.None) { hand.GrabObject(this); } }
private void OnToolPickedUp(Tool.ToolType type, int playerNum) { if (panel_type == TutorialEventController.TutorialStates.PICK_UP_TOOL_GO_TO_PATIENT && type != Tool.ToolType.DEFIBULATOR) { AddPlayerCircle(playerNum, type, false); } }
private void OnScalpelDroppedForSurgery(Tool.ToolType type) { if ((type == ToolType.SCALPEL) && !surgeryInitiated) { actionButtonCanvas.SetActive(true); actionButtonCanvas.GetComponent <BounceUpAndDown>().initiateBounce(); } }
private void OnInteraction(Interactable interactable, Hand hand, Tool.ToolType toolType) { if (toolType == Tool.ToolType.None) { hand.toolHandler.SetTool(inHandVersionPrefab); Destroy(gameObject); } }
public void OnSoakBlood(float duration) { var go = (GameObject)Instantiate(gauzeHotspotsPrefab, hotspotSpawnPos); go.transform.parent = hotspotSpawnPos; go.transform.localPosition = Vector3.zero; go.transform.localRotation = Quaternion.identity; requiredTool = Tool.ToolType.GAUZE; }
public void OnInteract(Interactable interactable, Hand hand, Tool.ToolType toolType) { Repairable repairable = interactable.GetComponent <Repairable>(); if (repairable != null) { repairable.RepairWithTool(toolType); } }
public void OnCutPatientOpen(float duration) { var go = (GameObject)Instantiate(scalpelTrackPrefab, hotspotSpawnPos); go.transform.parent = hotspotSpawnPos; go.transform.localPosition = Vector3.zero; go.transform.localRotation = Quaternion.identity; requiredTool = Tool.ToolType.SCALPEL; }
private void OnToolDropped(Tool.ToolType type) { if (type == ToolType.DEFIBULATOR) { if (!defibulatorUsedOnce && criticalEvent) { actionButtonCanvas.SetActive(true); actionButtonCanvas.GetComponent <BounceUpAndDown>().initiateBounce(); } } }
private void OnInteraction(Interactable interactable, Hand hand, Tool.ToolType toolType) { if (toolType == Tool.ToolType.Wrench) { gameObject.SetActive(false); Transform spawned = Instantiate(toSpawn, transform.position, transform.rotation); spawned.localScale = transform.lossyScale; spawned.GetComponent <Repairable>().currentState = GetComponent <Repairable>().currentState; gameObject.SetActive(false); socket.SetActive(true); } }
public void InformToolPickedUp(Tool.ToolType type, int playerNum) { if (tutorialActive) { toolsHeldByDoctor[playerNum] = type; OnToolPickedUp(type, playerNum); if (type == Tool.ToolType.BUCKET) { playerHasBucket = playerNum; } if (type == Tool.ToolType.DEFIBULATOR) { playerHasDefibulator = playerNum; } playerHasTool[playerNum] = type; } }
private void AddPlayerCircle(int playerNum, Tool.ToolType toolType, bool check) { if (playerCircleShown[playerNum]) { return; } if (current_state != StepCompletePanelState.SHOWING) { playerBuffer.Add(playerNum); } else { int i = 0; if (toolType == Tool.ToolType.SCALPEL) { if (circlesFilled[i] != -1) { i = 1; } } else if (toolType == Tool.ToolType.GAUZE) { i = 2; } else if (toolType == Tool.ToolType.SUTURE) { i = 3; } if (i == 0 && toolType != Tool.ToolType.SCALPEL) { return; } if (check) { AudioControl.Instance.PlayAddTutorialCircle(); } circlesFilled[i] = playerNum; playerCircleShown[playerNum] = true; playerCirclesChecked[playerNum] = check; playerCircles[i].GetComponent <PlayerCircle>().SetPlayerNumAndInitiateAnimation(playerNum, check); } }
public override void Interract(Tool.ToolType heldTool, float deltaTime) { if (Tutorial) { if (heldTool == Tool.ToolType.ElectricityKit) { health += repairSpeed * Time.deltaTime; if (health > 200f) { Working = true; health = 200f; healthBar.GetComponent <SpriteRenderer>().color = Color.green; } Vector2 scale = healthBar.transform.localScale; scale.x = health / 100; healthBar.transform.localScale = scale; } } }
public void RepairWithTool(Tool.ToolType toolType) { switch (toolType) { case Tool.ToolType.Hammer: if (currentState == RepairState.Twisted) { SpawnVersion(RepairState.Unpainted); Instantiate(repairFXPrefab, transform.position, Quaternion.identity); SoundManagerScript.instance.PlayOneShotSound(SoundManagerScript.AudioClips.ObjectRepair); } break; case Tool.ToolType.BlowPipe: if (currentState == RepairState.Damaged) { SpawnVersion(RepairState.Unpainted); Instantiate(repairFXPrefab, transform.position, Quaternion.identity); SoundManagerScript.instance.PlayOneShotSound(SoundManagerScript.AudioClips.ObjectRepair); } break; } }
public Tool Get_Tool(Tool.ToolType type, int level) { return((Tool)items.OrderByDescending(x => x is Tool ? (x as Tool).Level : 0).FirstOrDefault(x => x is Tool && (x as Tool).Type == type && (x as Tool).Level >= level)); }
public virtual void Interract(Tool.ToolType heldTool, float deltaTime) { }
public bool Has_Tool(Tool.ToolType type, int level) { return(Inventory.Has_Tool(type, level)); }
public void OnTutorialGauze() { Instantiate(gauzeHotspotsPrefab, hotspotSpawnPos); requiredTool = Tool.ToolType.GAUZE; }
private void OnToolForSurgeryPickedUp(Tool.ToolType type) { actionButtonCanvas.SetActive(true); actionButtonCanvas.GetComponent <BounceUpAndDown>().initiateBounce(); }
private void OnToolForSurgeryDropped(Tool.ToolType type) { actionButtonCanvas.SetActive(false); }
public void InformToolDropped(Tool.ToolType type, int playerNum) { toolsHeldByDoctor[playerNum] = Tool.ToolType.NONE; OnToolDropped(type, playerNum); playerHasTool[playerNum] = Tool.ToolType.NONE; }
public bool Has_Tool(Tool.ToolType type, int level) { return(items.Exists(x => x is Tool && (x as Tool).Type == type && (x as Tool).Level >= level)); }