public override void OnInspectorGUI() { base.OnInspectorGUI(); MiniGame mg = (MiniGame)target; if (GUILayout.Button("Start Mini Game")) { mg.StartMiniGame(); } }
private void EnterMiniGame(MiniGame miniGameToEnter, PlayableCharacter playableCharacter) { if (!buttonInstance.activeSelf) { buttonInstance.SetActive(true); PatternButtonAnim.SetTrigger(MiniGame.ButtonAnimations[XboxButton.A]); } else if (XCI.GetButtonDown(XboxButton.A, playableCharacter.PlayerController.controller) && playableCharacter.isAlive) { PatternButtonAnim.SetTrigger("white"); if (isBroken) { if (_brokenMiniGame.CharPos) { // if (!miniGameToEnter.desapireInEnter) playableCharacter.disableMovement(playerMoveInFixPos); playableCharacter.transform.position = _brokenMiniGame.CharPos.position; playableCharacter.PlayerController.isRight = _brokenMiniGame.CharFacingRight; stickTime = Time.fixedTime; } } else { if (CharPos) { // if (!miniGameToEnter.desapireInEnter) playableCharacter.disableMovement(playerMoveInFixPos); playableCharacter.transform.position = CharPos.position; playableCharacter.PlayerController.isRight = CharFacingRight; stickTime = Time.fixedTime; } } state = State.MINIGAME; miniGameToEnter.StartMiniGame(this, playableCharacter); } }
public void Update() { if (startedMiniGame_ && !currentMinigame_) { GameObject go = GameObject.FindGameObjectWithTag("MiniGame"); if (go) { currentMinigame_ = go.GetComponent <MiniGame>(); } } if (currentMinigame_) { if (!currentMinigame_.Started) { currentMinigame_.StartMiniGame(); } else if (currentMinigame_.Finished && !currentMinigame_.IsNeeded) { CloseMiniGame(); } } }
private void KickOffMiniGame(MiniGame mG) { miniGames.Add(mG); mG.StartMiniGame(this); }