private void ActionTriggerStay(Collider2D Other) { switch (Other.tag) { case "DoorTrigger": RoomsTransition.OpenNearestDoor(Other); if (Other.transform.position.y < GetComponent <Transform>().position.y) { StartCoroutine(RoomsTransition.HideAndShowHallway(Other.GetComponent <Text>().text.Split('.')[1].Substring(9))); } break; case "MiniGameTrigger": StartCoroutine(RoomsTransition.MoovCamera("mini game")); GetComponent <Animator>().SetBool("Hight", true); var nearestMiniGame = RoomsTransition.Minigames[RoomsTransition.NearestObjectByTag(Other, RoomsTransition.Minigames)]; nearestMiniGame.GetComponent <Animator>().SetBool("Show", true); MiniGameController.PlayMiniGame(nearestMiniGame); lockPlayerControl = !lockPlayerControl; break; default: var nameOfFather = Other.name; var father = GameObject.Find(nameOfFather); var childsCount = father.transform.GetChildCount(); for (int i = 0; i < childsCount; i++) { var child = father.transform.GetChild(i); child.gameObject.SetActive(!child.gameObject.activeSelf); } break; } }
// Use this for initialization public void Init() { Game.game.m_iScore = 0; m_gGameplayObject = new GameObject(); m_cAudioSource = m_gGameplayObject.AddComponent <AudioSource>(); Debug.Log("GameController: Init: m_iCurrentLevel: " + Game.game.m_iCurrentLevel); Debug.Log("GameController: Init: levelorder: " + Game.game.m_arrLevelOrder[Game.game.m_iCurrentLevel]); Debug.Log("GameController: Init: audio: " + Game.game.m_arrLevelAudio[Game.game.m_arrLevelOrder[Game.game.m_iCurrentLevel]]); m_cAudioSource.clip = (Game.game.m_arrLevelAudio[Game.game.m_arrLevelOrder[Game.game.m_iCurrentLevel]]); m_cAudioSource.Play(); //Init Player Controller //GameObject progressBar = Instantiate(Resources.Load(PROGRESS_BAR_PREFAB)) as GameObject; progressBarComponent = m_gGameplayObject.AddComponent <ProgressBar>(); progressBarComponent.Init(); //Init top map mapController = m_gGameplayObject.AddComponent <MapController>(); mapController.Init(); //Init combo meter comboMaker = m_gGameplayObject.AddComponent <ComboController>(); comboMaker.Init(); //Init games miniGamesController = m_gGameplayObject.AddComponent <MiniGameController>(); miniGamesController.Init(); Reset(); }
public void ManageEndDay() { if (_playerController.CurrentZone != null) { DidPlayMiniGame = true; _canvasGroup.alpha = 0; _canvasGroup.blocksRaycasts = false; MiniGameController mgc = Instantiate(_prefabGame); //prefab will call EndDay at the end of minigame if (_playerController.CurrentZone.CurrentWeather.RiskIncrease > 1) { mgc.SetWeather(MiniGameController.MiniGameWeather.RAINY); } else { mgc.SetWeather(MiniGameController.MiniGameWeather.SUNNY); //todo } mgc.SetTime(60); //1:30 } else { DidPlayMiniGame = false; EndDay(); } }
// Changed from Start to Awake to make sure it runs whether it's enabled or not // so that we don't get null pointer error void Awake() { trackedObj = GetComponent <SteamVR_TrackedObject>(); playerTransform = GameObject.FindGameObjectWithTag("Player").transform; mainCameraTransform = GameObject.FindGameObjectWithTag("MainCamera").transform; mgc = FindObjectOfType <MiniGameController> (); }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource> (); hc = FindObjectOfType <HopperController> (); noMoreShotsAudioSource = AddAudio(noMoreShotsClip, false, false, 0.07f); mgc = FindObjectOfType <MiniGameController> (); constantForce = GetComponent <ConstantForce> (); }
public void RevivePlayers() { MiniGameController.RepositionDeadPlayer(); foreach (var player in players) { player.gameObject.SetActive(true); } }
private void Start() { Debug.Log("gameController is " + gameController); Debug.Log("mainTimer is " + mainTimer); timer = mainTimer; gameController = gameControllerObject.GetComponent <MiniGameController>(); }
void Start() { miniGameTypes = new Dictionary<string, GameObject>(); miniGameTypes["dialog"] = dialog; miniGameTypes["platformer"] = platformer; miniGameTypes["laserPlumber"] = laserPlumber; miniGameTypes["RedBlueTurretPlatformer"] = redBluePlatformer; miniGameTypes["match3"] = match3; miniGameTypes["BullsAndCleots"] = bullsAndCleots; singleton = this; }
public void init(MiniGameController controllerPrime) { this.controllerPrime = controllerPrime; if (this.controllerPrime == null) { Debug.Log("Controller null in shot"); } else { Debug.Log("Controller null in shot"); } }
public void StartMiniGame() { // Debug.Log("Starting " + gameObject.name); m_CurrentScrollTime = 0; m_ScoreTimer = 0; m_TimeLimitTimer = 0; m_CurrentScrollingSpeed = data.baseLevelScrollSpeed; CameraHandler.UpdateScrollingType(data.cameraScrollingType); MiniGameController.RepositionPlayer(m_StartingPositions); if (m_Level) { m_Level.SetActive(false); } m_Level = ChooseLevel(); if (m_Level) { m_Level.SetActive(true); } else { Debug.LogError("Error loading level for minigame: " + data.name); } GlobalUIManager.instance.HideScoreObjective(); GlobalUIManager.instance.HideTimeLimit(); if (data.hasTimeLimit) { GlobalUIManager.instance.ShowTimeLimit(); } else if (data.hasScoreToReach) { GlobalUIManager.instance.ShowScoreObjective(); GlobalUIManager.instance.UpdateScoreObjective(data.scoreToReach); } if (isRunner) { SetupRunner(); } if (isKingOfTheHill) { SetupKotH(); } if (isCubePlacement) { SetupCubePlacement(); } if (data.shouldRemoveGround) { MiniGameController.instance.RemoveGroundAfter(data.timeBeforeRemoveGround); } StartCoroutine(StartWithDelay()); }
void Start() { //guarda todas as referências necessárias player = FindObjectOfType <PlayerController>(); interfaceScript = FindObjectOfType <InterfaceScript>(); cameraController = FindObjectOfType <CameraController>(); miniGameController = FindObjectOfType <MiniGameController>(); Invoke("DelayStart", 0.1f); //carrega qual foi o último vírus jogado //irá setar o currentVirusID no playerController LoadData(); }
void Awake() { if (controller == null) { DontDestroyOnLoad(gameObject); controller = this; } else if (controller != this) { Destroy(gameObject); } miniGameController = GetComponentInChildren <MiniGameController>(); }
void Awake() { if (controller == null) { DontDestroyOnLoad(gameObject); controller = this; } else if (controller != this) { Destroy(gameObject); } DontDestroyOnLoad(player); cameraController = mainCam.GetComponent <CameraController>(); miniGameController = GetComponentInChildren <MiniGameController>(); }
private void OnEnable() { if (isHacked) { testWord.text = ""; codeText.SetActive(true); return; } mgc = mgc_gb.GetComponent <MiniGameController>(); audioSource = GameObject.FindObjectOfType <AudioSource>(); currentWord = getWord(); correctWord.text = currentWord; progressBar.value = 0; score = 0f; streak = 0; }
// Start is called before the first frame update void Start() { codeText.text = ""; mgc = mgc_gb.GetComponent <MiniGameController>(); }
public OutcomeGameState(MiniGameController game) { this.game = game; }
void Awake() { Instance = this; }
void Awake() { if (controller == null) { DontDestroyOnLoad(gameObject); controller = this; } else if (controller != this) { Destroy(gameObject); } DontDestroyOnLoad(player); cameraController = mainCam.GetComponent<CameraController>(); miniGameController = GetComponentInChildren<MiniGameController>(); }
void Awake() { instance = this; }
public void init(MiniGameController controllerPrime, MiniGameController.minigameType type) { this.controllerPrime = controllerPrime; setType(type); }
void Start() { miniGameTypes = new Dictionary<string, GameObject>(); miniGameTypes["dialog"] = dialog; miniGameTypes["laserPlumber"] = laserPlumber; miniGameTypes["match3"] = match3; miniGameTypes["BullsAndCleots"] = bullsAndCleots; miniGameTypes["physics"] = physics; miniGameTypes["slideshow"] = slideshow; miniGameTypes["WaveDefense"] = waveDefense; miniGameTypes["pipePlatformer"] = pipePlatformer; miniGameTypes["stockSnake"] = stockSnake; miniGameTypes["timelapse"] = timelapse; singleton = this; }
// Use this for initialization void Start() { mgc = FindObjectOfType <MiniGameController> (); mgc.TargetSpawned(); timeAlive = mgc.resetTimeBetweenTargets; }
void GetMGC() { mgc = GameObject.FindGameObjectWithTag("MiniGameController").GetComponent<MiniGameController>(); }
public void SetGameControllerReference(MiniGameController controller) { gameController = controller; }
private void OnEnable() { codeText.text = ""; mgc = mgc_gb.GetComponent <MiniGameController>(); }
void Awake() { stageBoard = GetComponent <KeyboardSystem>(); controller = GetComponent <MiniGameController>(); }
void GetMGC() { mgc = GameObject.FindGameObjectWithTag("MiniGameController").GetComponent <MiniGameController>(); }
// Use this for initialization void Start() { mgc = FindObjectOfType <MiniGameController> (); displayText = GetComponentInChildren <Text> (); }