private IEnumerator plateMoveInst; // Keeps track of the current instance of the moving burger plate coroutine; allows us to stop the previous one and create a new one so that they don't fight each other over where the plate should be. void Start() { infoTextSlot.text = ""; // Empty our info panel immediately. backHome = true; ns1 = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <NarrativeScript1>(); if (!burgerSpawner) { burgerSpawner = GameObject.FindGameObjectWithTag("BurgerSpawner"); } bci = burgerSpawner.GetComponent <BurgerComponentInstantiator>(); bci.actSelect = this; Player = GameObject.FindGameObjectWithTag("BattlePlayer"); uiAnim = combatUI.GetComponent <Animator>(); // At start, we also want to turn off all the Combo and Item icons and their text and outlines. ToggleText(comboHolder, false, true); ToggleText(itemHolder, false, false); StartCoroutine(StartStuff()); enemyReset = true; //isReady = true; //BCI = GameObject.FindGameObjectWithTag("BurgerSpawner"); }
void Awake() //sets variables for other scripts, mostly { burgerSpawner = GameObject.Find("BurgerSpawner"); BCI = burgerSpawner.GetComponent <BurgerComponentInstantiator>(); anim = GetComponent <Animator>(); sprite = GetComponent <SpriteRenderer>(); //sprite.sortingOrder = BCI.componentNumber; restingPosition = new Vector3(0, transform.position.y, 0); bouncingPosition = new Vector3(0, transform.position.y - 0.1f, 0); prevTrigger = BCI.bounceTrigger; StartCoroutine(Bounce()); if (dontDespawn == false) { StartCoroutine(Despawn()); } }
void Start() { startPosition = new Vector3(start.position.x, start.position.y, start.position.z); endPosition = new Vector3(end.position.x, end.position.y, end.position.z); //gameObject.transform.position.Set(start.position.x, start.position.y, start.position.z); anim = GetComponent <Animator>(); player = GameObject.Find("Player"); ph = player.GetComponent <PlayerHealth>(); burgerSpawner = GameObject.Find("BurgerSpawner"); //clock = GameObject.Find("UIClock"); //clockAnim = clock.GetComponent<Animator>(); //cheeseAnim = cheese.GetComponent<Animator>(); //tearAnim = tear.GetComponent<Animator>(); BCI = burgerSpawner.GetComponent <BurgerComponentInstantiator>(); movingForwards = true; seconds = Mathf.RoundToInt(enemySpeed - 2); mainCamera = GameObject.Find("Main Camera"); background = mainCamera.GetComponent <AudioSource>(); clock = GameObject.Find("ClockUI"); }
void Start() { gameController = GameObject.FindGameObjectWithTag("GameController"); burgerSpawner = GameObject.Find("BurgerSpawner"); playerHealth = gameController.GetComponent <BattleTranistions>().playerHealth; // takes from the gameController for now, will probably be changed to the overworld player controller BCI = burgerSpawner.GetComponent <BurgerComponentInstantiator>(); healthText.text = playerHealth.ToString(); for (int i = 0; i < healthAnim.Length; i++) { healthAnim[i].SetBool("Healing", true); if (i == roundedHealth) { healthAnim[roundedHealth].SetInteger("Health", playerHealth % 10); } else if (i == roundedPreviousHealth) { healthAnim[roundedPreviousHealth].SetInteger("Health", 10); } } healthText.text = playerHealth.ToString(); }
void Start() { burgerSpawner = GameObject.Find("BurgerSpawner"); BCI = burgerSpawner.GetComponent <BurgerComponentInstantiator>(); }