void Start() { StartCoroutine(start2()); //gameParameters.currentCharacter = "Bann"; //character = gameParameters.currentCharacter; if (gameParameters.currentCharacter != null) { } if (PlayerPrefs.HasKey("currentCharacter")) { gameParameters.currentCharacter = PlayerPrefs.GetString("currentCharacter"); } if (!PlayerPrefs.HasKey("currentCharacter")) { gameParameters.currentCharacter = "Finnikin"; PlayerPrefs.SetString("currentCharacter", gameParameters.currentCharacter); } string str = ("Characters/" + PlayerPrefs.GetString("currentCharacter") + "/theme"); Debug.Log(str); GameObject bg = Instantiate(Resources.Load(str), new Vector3(0, 0, 0), Quaternion.identity) as GameObject; GameObject chara = GameObject.FindWithTag("character"); anim = chara.GetComponent <characterManager>(); chara.transform.parent = characterPos.transform; anim.playHappy(); StartCoroutine(start2()); // chara.transform.position = new Vector2(0, 0); //chara.SetActive(false); }
void Awake() { au = GetComponent <AudioSource>(); GameObject g = GameObject.FindWithTag("fadeManager"); if (g != null) { fm = g.GetComponent <fadeManager>(); } GameObject bg = Instantiate(Resources.Load("Characters/" + gameParameters.currentCharacter + "/theme"), new Vector3(0, 0, 0), Quaternion.identity) as GameObject; character = GameObject.FindWithTag("character"); if (character != null) { cm = character.GetComponent <characterManager>(); } }
void Awake() { anim = GetComponent <Animator>(); anim2 = buttons.GetComponent <Animator>(); GameObject f = GameObject.FindWithTag("fadeManager"); if (f != null) { fm = f.GetComponent <fadeManager>(); } GameObject g = GameObject.FindWithTag("gameManager"); if (g != null) { gm = g.GetComponent <gameManager>(); } GameObject c = GameObject.FindWithTag("character"); if (c != null) { cm = c.GetComponent <characterManager>(); } }