void Start() { monkey = GameObject.Find("monkey"); rhino = GameObject.Find("rhino"); pigEvilScript = GameObject.Find("pigEvil").GetComponent <pigEvil>(); zebraSafeBoxCheck = GameObject.Find("timerObjectZebra").GetComponent <timerZebra_Level_06>(); currentLevelName = Application.loadedLevelName; guiText.text = ("Time left: " + levelTimer.ToString("f0")); highlightZebMeercat01 = GameObject.Find("highlightZebMeercat01"); highlightZebMeercat02 = GameObject.Find("highlightZebMeercat02"); highlightZebMeercat03 = GameObject.Find("highlightZebMeercat03"); highlightZebRabbit01 = GameObject.Find("highlightZebRabbit01"); highlightZebRabbit02 = GameObject.Find("highlightZebRabbit02"); highlightZebRabbit03 = GameObject.Find("highlightZebRabbit03"); highlightZebRabbit04 = GameObject.Find("highlightZebRabbit04"); highlightZebTeller01 = GameObject.Find("highlightZebTeller01"); highlightZebTeller02 = GameObject.Find("highlightZebTeller02"); highlightZebTeller03 = GameObject.Find("highlightZebTeller03"); highlightZebTeller04 = GameObject.Find("highlightZebTeller04"); highlightZebTeller05 = GameObject.Find("highlightZebTeller05"); highlightZebTeller06 = GameObject.Find("highlightZebTeller06"); highlightZebSafebox = GameObject.Find("highlightZebSafebox"); highlightZebSafebox02 = GameObject.Find("highlightZebSafebox02"); moneyTextMeercat01 = GameObject.Find("moneyTextMeercat01"); moneyTextMeercat02 = GameObject.Find("moneyTextMeercat02"); moneyTextMeercat03 = GameObject.Find("moneyTextMeercat03"); moneyTextRabbit01 = GameObject.Find("moneyTextRabbit01"); moneyTextRabbit02 = GameObject.Find("moneyTextRabbit02"); moneyTextRabbit03 = GameObject.Find("moneyTextRabbit03"); moneyTextRabbit04 = GameObject.Find("moneyTextRabbit04"); moneyTextTeller01 = GameObject.Find("moneyTextTeller01"); moneyTextTeller02 = GameObject.Find("moneyTextTeller02"); moneyTextTeller03 = GameObject.Find("moneyTextTeller03"); moneyTextTeller04 = GameObject.Find("moneyTextTeller04"); moneyTextTeller05 = GameObject.Find("moneyTextTeller05"); moneyTextTeller06 = GameObject.Find("moneyTextTeller06"); moneyTextSafebox = GameObject.Find("moneyTextSafebox"); moneyTextSafebox02 = GameObject.Find("moneyTextSafebox02"); scoreGUItext = GameObject.Find("scoreGUItext"); timerGUIText = GameObject.Find("timerGUIText"); score = GameObject.Find("scoreGUItext").GetComponent <gameScore_Level_06>(); timerBGObject = GameObject.Find("timerBG"); timerObjectZebra = GameObject.Find("timerObjectZebra"); int screenWidthX = Screen.width; int screenHeightY = Screen.height; Vector3 timerBGPos = Camera.main.WorldToScreenPoint(timerBGObject.transform.position); float timerPos_x = (timerBGPos.x / screenWidthX); float timerPos_y = (timerBGPos.y / screenHeightY); this.transform.position = new Vector3(timerPos_x, timerPos_y - 0.01f, 0); zebra = GameObject.Find("zebra"); zebraDummy = GameObject.Find("zebraDummy"); endResultScript = GameObject.Find("endResult").GetComponent <endResult>(); guiText.fontSize = (int)(Screen.width * 0.05f); }
void Start () { dummyCameraZoon01 = GameObject.Find ("dummyCameraZoon01"); dummyCameraZoon02 = GameObject.Find ("dummyCameraZoon02"); camera = GameObject.Find ("Main Camera"); AudioSource[] audios = GetComponents<AudioSource>(); drag = audios[0]; moneyDone = audios[1]; //position on shelf dummyPos1 = GameObject.Find ("dummyPos1"); dummyPos2 = GameObject.Find ("dummyPos2"); dummyPos3 = GameObject.Find ("dummyPos3"); dummyPos4 = GameObject.Find ("dummyPos4"); zebraDummy = GameObject.Find ("zebraDummy"); if (PlayerPrefs.GetString("chaPos1") == "zebra") { transform.position = dummyPos1.transform.position; shelfPos = dummyPos1.transform.position; zebraDummy.transform.position = shelfPos; } else if (PlayerPrefs.GetString("chaPos2") == "zebra") { transform.position = dummyPos2.transform.position; shelfPos = dummyPos2.transform.position; zebraDummy.transform.position = shelfPos; } else if (PlayerPrefs.GetString("chaPos3") == "zebra") { transform.position = dummyPos3.transform.position; shelfPos = dummyPos3.transform.position; zebraDummy.transform.position = shelfPos; } else if (PlayerPrefs.GetString("chaPos4") == "zebra") { transform.position = dummyPos4.transform.position; shelfPos = dummyPos4.transform.position; zebraDummy.transform.position = shelfPos; } dummyPosition = GameObject.Find ("dummyPos"+dummyPosNo); timerObjectZebra = GameObject.Find ("timerObjectZebra"); timerZebra = GameObject.Find ("timerObjectZebra").GetComponent<timerZebra_Level_06>(); monkey = GameObject.Find ("monkey"); timerMonkey = GameObject.Find ("timerObjectMonkey").GetComponent<timerMonkey_Level_06>(); rhino = GameObject.Find ("rhino"); timerRhino = GameObject.Find ("timerObjectRhino").GetComponent<timerRhino_Level_06>(); highlightMonMeercat01 = GameObject.Find ("highlightMonMeercat01"); highlightMonMeercat02 = GameObject.Find ("highlightMonMeercat02"); highlightMonMeercat03 = GameObject.Find ("highlightMonMeercat03"); highlightMonRabbit01 = GameObject.Find ("highlightMonRabbit01"); highlightMonRabbit02 = GameObject.Find ("highlightMonRabbit02"); highlightMonRabbit03 = GameObject.Find ("highlightMonRabbit03"); highlightMonRabbit04 = GameObject.Find ("highlightMonRabbit04"); highlightMonTeller01 = GameObject.Find ("highlightMonTeller01"); highlightMonTeller02 = GameObject.Find ("highlightMonTeller02"); highlightMonTeller03 = GameObject.Find ("highlightMonTeller03"); highlightMonTeller04 = GameObject.Find ("highlightMonTeller04"); highlightMonTeller05 = GameObject.Find ("highlightMonTeller05"); highlightMonTeller06 = GameObject.Find ("highlightMonTeller06"); highlightMonSafebox = GameObject.Find ("highlightMonSafebox"); highlightMonSafebox02 = GameObject.Find ("highlightMonSafebox02"); highlightZebMeercat01 = GameObject.Find ("highlightZebMeercat01"); highlightZebMeercat02 = GameObject.Find ("highlightZebMeercat02"); highlightZebMeercat03 = GameObject.Find ("highlightZebMeercat03"); highlightZebRabbit01 = GameObject.Find ("highlightZebRabbit01"); highlightZebRabbit02 = GameObject.Find ("highlightZebRabbit02"); highlightZebRabbit03 = GameObject.Find ("highlightZebRabbit03"); highlightZebRabbit04 = GameObject.Find ("highlightZebRabbit04"); highlightZebTeller01 = GameObject.Find ("highlightZebTeller01"); highlightZebTeller02 = GameObject.Find ("highlightZebTeller02"); highlightZebTeller03 = GameObject.Find ("highlightZebTeller03"); highlightZebTeller04 = GameObject.Find ("highlightZebTeller04"); highlightZebTeller05 = GameObject.Find ("highlightZebTeller05"); highlightZebTeller06 = GameObject.Find ("highlightZebTeller06"); highlightZebSafebox = GameObject.Find ("highlightZebSafebox"); highlightZebSafebox02 = GameObject.Find ("highlightZebSafebox02"); moneyTeller01 = GameObject.Find ("moneyTeller01"); moneyTeller02 = GameObject.Find ("moneyTeller02"); moneyTeller03 = GameObject.Find ("moneyTeller03"); moneyTeller04 = GameObject.Find ("moneyTeller04"); moneyTeller05 = GameObject.Find ("moneyTeller05"); moneyTeller06 = GameObject.Find ("moneyTeller06"); moneySafebox = GameObject.Find ("moneySafebox"); moneySafebox02 = GameObject.Find ("moneySafebox02"); anim = this.GetComponent<Animator>(); }