예제 #1
0
	void Start ()
	{
		AudioSource[] audios = GetComponents<AudioSource>();
		drag = audios[0];
		moneyDone = audios[1];

		//monkey position on shelf
		dummyPos1 = GameObject.Find ("dummyPos1");
		dummyPos2 = GameObject.Find ("dummyPos2");
		dummyPos3 = GameObject.Find ("dummyPos3");
		dummyPos4 = GameObject.Find ("dummyPos4");

		Debug.Log ("chaPos1" + PlayerPrefs.GetString("chaPos1"));
		Debug.Log ("chaPos2" +PlayerPrefs.GetString("chaPos2"));
		Debug.Log ("chaPos3" +PlayerPrefs.GetString("chaPos3"));
		Debug.Log ("chaPos4" +PlayerPrefs.GetString("chaPos4"));

		monkeyDummy = GameObject.Find ("monkeyDummy");

		highlightZebMeercat01 = GameObject.Find ("highlightZebMeercat01");
		highlightZebMeercat02 = GameObject.Find ("highlightZebMeercat02");
		highlightZebMeercat03 = GameObject.Find ("highlightZebMeercat03");
		highlightZebRabbit01 = GameObject.Find ("highlightZebRabbit01");
		highlightZebTeller01 = GameObject.Find ("highlightZebTeller01");
		highlightZebTeller02 = GameObject.Find ("highlightZebTeller02");
		highlightZebTeller03 = GameObject.Find ("highlightZebTeller03");

		if (PlayerPrefs.GetString("chaPos1") == "monkey")
		{
			transform.position = dummyPos1.transform.position;
			shelfPos = dummyPos1.transform.position;
			monkeyDummy.transform.position = shelfPos;
		}
		else if (PlayerPrefs.GetString("chaPos2") == "monkey")
		{
			transform.position = dummyPos2.transform.position;
			shelfPos = dummyPos2.transform.position;
			monkeyDummy.transform.position = shelfPos;
		}
		else if (PlayerPrefs.GetString("chaPos3") == "monkey")
		{
			transform.position = dummyPos3.transform.position;
			shelfPos = dummyPos3.transform.position;
			monkeyDummy.transform.position = shelfPos;
		}
		else if (PlayerPrefs.GetString("chaPos4") == "monkey")
		{
			transform.position = dummyPos4.transform.position;
			shelfPos = dummyPos4.transform.position;
			monkeyDummy.transform.position = shelfPos;
		}
		else if (highlightZebMeercat01)
		{
			Destroy(highlightZebMeercat01);
			Destroy(highlightZebMeercat02);
			Destroy(highlightZebMeercat03);
			Destroy(highlightZebRabbit01);
			Destroy(highlightZebTeller01);
			Destroy(highlightZebTeller02);
			Destroy(highlightZebTeller03);
		}


		timerObjectMonkey = GameObject.Find ("timerObjectMonkey");
		timerMonkey = GameObject.Find ("timerObjectMonkey").GetComponent<timerMonkey_Level_03>();

		highlightMonMeercat01 = GameObject.Find ("highlightMonMeercat01");
		highlightMonMeercat02 = GameObject.Find ("highlightMonMeercat02");
		highlightMonMeercat03 = GameObject.Find ("highlightMonMeercat03");
		highlightMonRabbit01 = GameObject.Find ("highlightMonRabbit01");
		highlightMonTeller01 = GameObject.Find ("highlightMonTeller01");
		highlightMonTeller02 = GameObject.Find ("highlightMonTeller02");
		highlightMonTeller03 = GameObject.Find ("highlightMonTeller03");



		moneyTextMeercat01 = GameObject.Find ("moneyTextMeercat01");
		moneyTextMeercat02 = GameObject.Find ("moneyTextMeercat02");
		moneyTextMeercat03 = GameObject.Find ("moneyTextMeercat03");
		moneyTextRabbit01 = GameObject.Find ("moneyTextRabbit01");
		moneyTextTeller01 = GameObject.Find ("moneyTextTeller01");
		moneyTextTeller02 = GameObject.Find ("moneyTextTeller02");
		moneyTextTeller03 = GameObject.Find ("moneyTextTeller03");

		moneyTeller01 = GameObject.Find ("moneyTeller01");
		moneyTeller02 = GameObject.Find ("moneyTeller02");
		moneyTeller03 = GameObject.Find ("moneyTeller03");
	
		anim = this.GetComponent<Animator>();
	}	
예제 #2
0
	void Start ()
	{

		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;
		}




		timerObjectZebra = GameObject.Find ("timerObjectZebra");
		timerZebra = GameObject.Find ("timerObjectZebra").GetComponent<timerZebra_Level_03>();
		monkey = GameObject.Find ("monkey"); 
		timerMonkey = GameObject.Find ("timerObjectMonkey").GetComponent<timerMonkey_Level_03>();
		rhino = GameObject.Find ("rhino"); 
		timerRhino = GameObject.Find ("timerObjectRhino").GetComponent<timerRhino_Level_03>();

		highlightMonMeercat01 = GameObject.Find ("highlightMonMeercat01");
		highlightMonMeercat02 = GameObject.Find ("highlightMonMeercat02");
		highlightMonMeercat03 = GameObject.Find ("highlightMonMeercat03");
		highlightMonRabbit01 = GameObject.Find ("highlightMonRabbit01");
		highlightMonTeller01 = GameObject.Find ("highlightMonTeller01");
		highlightMonTeller02 = GameObject.Find ("highlightMonTeller02");
		highlightMonTeller03 = GameObject.Find ("highlightMonTeller03");
		highlightMonSafebox = GameObject.Find ("highlightMonSafebox");
		
		highlightZebMeercat01 = GameObject.Find ("highlightZebMeercat01");
		highlightZebMeercat02 = GameObject.Find ("highlightZebMeercat02");
		highlightZebMeercat03 = GameObject.Find ("highlightZebMeercat03");
		highlightZebRabbit01 = GameObject.Find ("highlightZebRabbit01");
		highlightZebTeller01 = GameObject.Find ("highlightZebTeller01");
		highlightZebTeller02 = GameObject.Find ("highlightZebTeller02");
		highlightZebTeller03 = GameObject.Find ("highlightZebTeller03");
		highlightZebSafebox = GameObject.Find ("highlightZebSafebox");
	

		moneyTeller01 = GameObject.Find ("moneyTeller01");
		moneyTeller02 = GameObject.Find ("moneyTeller02");
		moneyTeller03 = GameObject.Find ("moneyTeller03");
		moneySafebox = GameObject.Find ("moneySafebox");
		
		anim = this.GetComponent<Animator>();
	}