private void HandleHeroExitTrigger(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.Elevator) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } Instructions.Instance.Hide(); _showInstructions = false; }
private void HandleStartInteract(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.PullFuseFromRobot) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } if (_fuseObject == null) { Debug.Log("fuse object is null"); return; } Hero.Instance.AddFuse(); if (_fuseObject) { Destroy(_fuseObject); _fuseObject = null; } FallOver(); Instructions.Instance.Hide(); _showInstructions = false; }
private void HandleHeroEnterTrigger(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.Elevator) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } _showInstructions = true; }
private void HandleAutoTrigger(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.WalkThroughDoor) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } if (_collider.activeSelf == true) { Debug.Log("Already triggered door blocker"); return; } Debug.Log("Close and block door"); _collider.SetActive(true); _door.Close(autoCloseIfOpening: true); }
private void HandleHeroInteract(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.Power) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } TogglePower(); }
private void HandleStartInteract(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.Door) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } if (HasFuse == false) { Debug.Log("Target fuse station " + _fuseStation.name + " is not working"); return; } if (HasMotor == false) { Debug.Log("Target fuse station motor " + _fuseStation.name + " is not working"); return; } if (HasPower == false) { Debug.Log("Power Station does not have power"); return; } if (CanBeOpened) { Open(); } else if (CanBeClosed && _allowHeroToCloseDoor) { Close(); } else { Debug.Log("Door is in State." + _door0.CurrentState); } }
private void HandleStartInteract(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.Fuse) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } // Do nothing if the door is moving if (_door.IsMoving) { return; } // If the door is open, either interact with the fuse or close the box if (IsOpen) { switch (State) { case FuseState.Bad: SetFuseState(FuseState.Empty); if (PowerStation.Instance.HasPower) { //Hero.Instance.Die(); } break; case FuseState.Empty: if (Hero.Instance.FuseCount > 0) { Hero.Instance.RemoveFuse(); SetFuseState(FuseState.Good); if (PowerStation.Instance.HasPower) { //Hero.Instance.Die(); } } break; case FuseState.Good: _door.Close(); break; } } // If the door is closed, and the fuse is not good, open it else { if (State != FuseState.Good) { _door.Open(); } else { Instructions.Instance.Hide(); } } }
private void HandleStartInteract(HeroTriggerType triggerType) { if (triggerType != HeroTriggerType.Gear) { Debug.LogError("Weird: " + this.GetType().ToString() + " received HeroTriggerType." + triggerType.ToString()); return; } if (IsReady) { Debug.Log("Already set"); return; } if (_state == State.Turn) { Debug.Log("Turning"); return; } if (_state == State.Reset) { Debug.Log("Resetting"); return; } if (_fuseStation.IsFuseReady == false) { Debug.Log("Fuse is not ready"); return; } Crank(); }