// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody>(); game_master_script = GameObject.Find("GameMaster").GetComponent <GameMasterScript>(); camera_script = GameObject.Find("Main Camera").GetComponent <CameraControls>(); GameObject win_trigger = GameObject.FindWithTag("Goal"); win_trigger_trans = win_trigger.GetComponent <Transform>(); win_trigger_script = win_trigger.GetComponent <WinTrigger>(); eye_trans = eye.GetComponent <Transform>(); eye_mat = eye.GetComponent <MeshRenderer>().materials[0]; //beam_mat = beam.GetComponent<MeshRenderer>().materials[0]; beam_trans = beam.GetComponent <Transform>(); beam.SetActive(false); beaming = false; moving = false; direction = new Vector3(); next_pos = rb.position; rotation = rb.rotation.y; pushing = false; speed = Utility.CHARACTER_SPEED; elevator_trigger = false; //emission_color = Color.black; intensity = 0; SetLight(intensity); }
public static CampaignNode InitializeCampaign() { //Initialize Tutorial Mission Instantiators WinCondition winCon = new WinCondition(); TutorialMoneyInitialier moneyInit = new TutorialMoneyInitialier(); //Initialize Tutorial Missin Triggers WinTrigger win = new WinTrigger(); SpeakTrigger tutorial_First_Mayor = new SpeakTrigger(SpeakerType.Mayor, 1, "I will get your medicine"); SpeakTrigger tutorial_First_Shopkeeper = new SpeakTrigger(SpeakerType.ShopKeeper, 1, "Do you know where to find money?"); PickupTrigger tutorialMoneyCollection = new PickupTrigger("Money", 5); SpeakTrigger tutorial_Second_Shopkeeper = new SpeakTrigger(SpeakerType.ShopKeeper, 1, "Here is the money you asked for"); PickupTrigger pickUpMedicine = new PickupTrigger("Mayor_Medicine", 1); SpeakTrigger tutorial_Second_Mayor = new SpeakTrigger(SpeakerType.Mayor, 1, "Here is your medicine"); CampaignNode temp; CampaignNode next; //Contruct the campaign tree next = new CampaignNode(null, null, win, 7, "You Win!", winCon); temp = new CampaignNode(next, null, tutorial_Second_Mayor, 6, "Return to the Mayor to give him his medicine"); //next = temp; //temp = new CampaignNode(next, null, pickUpMedicine, 5, "Pickup Medicine from the Shopkeeper"); next = temp; temp = new CampaignNode(next, null, tutorial_Second_Shopkeeper, 4, "Return to the Shopkeeper with the money"); next = temp; temp = new CampaignNode(next, null, tutorialMoneyCollection, 3, "Collect 5 money to pay the Shopkeeper for the Mayor's medicine", moneyInit); next = temp; temp = new CampaignNode(next, null, tutorial_First_Shopkeeper, 2, "Talk to the Shopkeeper about the Mayor's medicine"); next = temp; temp = new CampaignNode(next, null, tutorial_First_Mayor, 1, "Talk to the Mayor"); return(temp); }
// Start is called before the first frame update void Start() { InvokeRepeating("SlowDecreaseHunger", 5.0f, 0.4f); img.fillAmount = hunger; healthScript = GetComponent <PlayerHealth>(); winTrigger = endTrigger.GetComponent <WinTrigger>(); }
public void Reset(bool playerDied = false) { complete = false; foreach (Enemy enemy in enemies) { Destroy(enemy.gameObject); } enemies = new List <Enemy>(); var spawners = FindObjectsOfType <EnemySpawner>(); foreach (EnemySpawner spawner in spawners) { spawner.Reset(); } WinTrigger trigger = FindObjectOfType <WinTrigger>(); trigger.Reset(); if (!playerDied) { StartCoroutine("SendPlayerToStart"); } }
// Start is called before the first frame update void Start() { InvokeRepeating("ResetDestination", 0.0f, recalculateTime); hungerScript = player.GetComponent <PlayerHunger>(); healthScript = player.GetComponent <PlayerHealth>(); playerRb = player.GetComponent <Rigidbody>(); winTrigger = endTrigger.GetComponent <WinTrigger>(); rb = GetComponent <Rigidbody>(); dustEmitter = GetComponent <DustEmitter>(); dustEmitter.stopped = false; }
public LevelActiveState(LevelFSM stateMachine, LevelController levelController) { _stateMachine = stateMachine; _winTrigger = levelController.WinTrigger; _playerSpawner = levelController.PlayerSpawner; _gameSession = GameSession.Instance; _playtimeScreen = levelController.LevelHUD.PlaytimeScreen; _cameraController = levelController.CameraController; _menuInput = levelController.MenuInput; }
private void OnTriggerExit(Collider other) { WinTrigger w = other.GetComponent <WinTrigger>(); if (w) { inWinTrigger = false; } Tree t = other.GetComponent <Tree>(); if (t) { currentTree = null; woodNotice.enabled = false; } }
private void OnTriggerEnter(Collider other) { WinTrigger w = other.GetComponent <WinTrigger>(); if (w) { inWinTrigger = true; } Tree t = other.GetComponent <Tree>(); if (t) { currentTree = t; if (t.hasWood) { woodNotice.enabled = true; } } }
// Use this for initialization void Start() { winScreen.SetActive(false); myTrigger = GameObject.Find("Screen Wipe").GetComponent <WinTrigger>(); }
public void OnWinTriggered(WinTrigger win) { Debug.Log("win triggered"); Destroy(win.gameObject); SceneManager.LoadScene(2); }