void Update() { iSM = GameObject.Find("InterSceneManager").GetComponent <InterSceneManager>(); if (StartPan.activeSelf == true) { if (Input.anyKey == true) { StartPan.SetActive(false); StartKulisse.SetActive(false); SelectPan.SetActive(true); SelectKulisse.SetActive(true); foreach (PlayerStats pS in iSM.pS) { pS.pIndex = 0; pS.pPrefab = null; } SelectPan.GetComponent <SelectMenu>().UpdateMenu(); } } else if (SelectPan.activeSelf == true) { } }
public void UpdateThis() { iSM = GameObject.Find("InterSceneManager").GetComponent <InterSceneManager>(); img.sprite = chara.GetComponent <Character>().icon; cName.text = chara.GetComponent <Character>().pName; foreach (PlayerStats pS in iSM.pS) { selectIcon[pS.playerNumber - 1].GetComponent <Image>().color = pS.pColor; if (pS.pIndex == index) { selectIcon[pS.playerNumber - 1].SetActive(true); } else { selectIcon[pS.playerNumber - 1].SetActive(false); } if (pS.pPrefab == chara) { selectIcon[pS.playerNumber - 1].GetComponent <Animator>().SetBool("Selected", true); } else { selectIcon[pS.playerNumber - 1].GetComponent <Animator>().SetBool("Selected", false); } } }
public void UpdateMenu() { iSM = GameObject.Find("InterSceneManager").GetComponent <InterSceneManager>(); foreach (GameObject cS in charSelectBtn) { cS.GetComponent <SelectPan>().UpdateThis(); } bool startGame = true; foreach (PlayerStats pS in iSM.pS) { if (pS.pPrefab == null) { startGame = false; } } if (startGame == true) { countDown = true; counter = 3; } else { if (countDown == true) { countDown = false; } } }
public void Start() { iSM = GameObject.Find("InterSceneManager").GetComponent <InterSceneManager>(); pList.Clear(); foreach (PlayerStats pS in iSM.pS) { GameObject obj = Instantiate(pS.pPrefab); Vector3 pos = startPos[pS.playerNumber - 1].position; obj.transform.position = pos; if (pS.playerNumber == 2) { obj.transform.rotation = Quaternion.Euler(0, -180, 0); } else if (pS.playerNumber == 1) { obj.transform.rotation = Quaternion.Euler(0, 0, 0); } Player p = obj.GetComponent <Player>(); p.playerNumber = pS.playerNumber; p.health = 200; p.energy = 0; p.pColor = pS.pColor; pList.Add(p); bars[pS.playerNumber - 1].player = p; } itemCounter = Random.Range(5, 15); FightIsOn = true; }
private void Awake() { if (Instance == null) { Instance = this; Initialize(); } else { Destroy(gameObject); } }
public void Start() { DontDestroyOnLoad(gameObject); if (iSM == null) { iSM = this; } else { Destroy(gameObject); } mM = GameObject.Find("MainMenu").GetComponent <MainMenu>(); AudioManager.instance.MusicStart(); tColor = txtList[0].color; }