void Start() { _startElevatorHeight = Elevator.position.y; LiftLeversSwitched += (ElevatorLiftStage cond) => _movingDirection = cond; _previousPipe = GameObject.FindGameObjectWithTag("PreviousPipe").GetComponent <PipeStaticTriggerHandler>(); PreviousPipe.transform.parent = null; SetGateOpenClose(); _gkshRing = GKSHTriggerHandler.Instance.transform; }
private void SetCurrentPipe() { var elevatorShell = ElevatorCatch.parent; var elevatorShellRigidbody = elevatorShell.GetComponent <Rigidbody>(); elevatorShellRigidbody.isKinematic = true; elevatorShell.position = ElevatorShellJointPosition; elevatorShell.rotation = Quaternion.Euler(ElevatorShellJointRotation); _currentPipe = Instantiate(PipeStaticPrefab, PipeShellJointPosition, Quaternion.Euler(PipeShellJointRotation)) .GetComponentInChildren <PipeStaticTriggerHandler>(); _currentPipe.name = string.Format("{0} (Cycle: {1})", _currentPipe.name, _cycleCount); _currentPipe.transform.parent = ElevatorCatch; elevatorShellRigidbody.isKinematic = false; }
public void PreviusPipeDestroyed() { _previousPipe = _currentPipe; _currentPipe = null; }