public void ChangeGameObject() { GO.GetComponentInChildren <Animator>().runtimeAnimatorController = GameManager.Instance.SM.animators[GameManager.Instance.SM.GetComponent <CostumeCollection>().GuitaristCostumes.IndexOf(sprite)].runtimeAnimatorController; GO.GetComponentInChildren <GuitarEditor>().GetComponent <SpriteRenderer>().sprite = Guitar; GO.GetComponentInChildren <TextMesh>().text = Name; GO.GetComponentInChildren <TextMesh>().GetComponent <Renderer>().sortingLayerName = "UI"; }
public T SetupComponent <T>() where T : Component { var temp = GO.GetComponentInChildren <T>(); if (temp == null) { temp = EnsureComponet <T>(); } return(temp); }
public virtual T SetupMonoBehaviour <T>() where T : MonoBehaviour { var temp = GO.GetComponentInChildren <T>(); if (temp == null) { temp = EnsureComponet <T>(); } return(temp); }
public virtual T SetupMono <T>() where T : BaseMono { var temp = GO.GetComponentInChildren <T>(); if (temp == null) { temp = EnsureComponet <T>(); } temp.OnBeSetup(); return(temp); }
public static void enigmaEnd() { foreach (GameObject GO in SceneManager.GetActiveScene().GetRootGameObjects()) { //print("Checking RootGameObjects in Scene " + SceneManager.GetActiveScene().name); if (GO.GetComponentInChildren <Enigma>() != null) { //get scene's Enigma GO.GetComponentInChildren <Enigma>().enigmaEnd(); print("end enigma"); } } }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { SceneManager.SetActiveScene(scene); print("OnSceneLoaded " + scene.name); print("Active: " + SceneManager.GetActiveScene().name); //load the saved information to in the new scene using datacontrol DataControl.control.Load(); foreach (GameObject GO in scene.GetRootGameObjects()) { //print("Checking RootGameObjects in Scene " + SceneManager.GetActiveScene().name); if (GO.GetComponentInChildren <Enigma>() != null) { //get scene's Enigma GO.GetComponentInChildren <Enigma>().enigmaUpdate(); } } }
public void SpawnPlatform(string Texto) { if (Plataformas.Count < PoolingLimit) { GameObject GO; GO = Instantiate(PlatformPrefab); GO.transform.position = Fontes [3].transform.position; if (Plataformas.Count != 0) { Vector2 posicao = GO.transform.position; posicao.x += Texto.Length * 0.3f; GO.transform.position = posicao; } Plataformas.Add(GO); Text TextoDaPlatforma; TextoDaPlatforma = GO.GetComponentInChildren <Text> (); TextoDaPlatforma.text = Texto; Vector3 TamanhoHitbox = GO.GetComponent <BoxCollider2D> ().size; TamanhoHitbox.x = Texto.Length * 0.0065f; GO.GetComponent <BoxCollider2D> ().size = TamanhoHitbox; } else { PoolingCOunter++; if (PoolingCOunter > PoolingLimit - 1) { PoolingCOunter = 0; } Plataformas [PoolingCOunter].transform.position = this.transform.position; Vector2 posicao = Plataformas [PoolingCOunter].transform.position; posicao.x += Texto.Length * 0.3f; Plataformas [PoolingCOunter].transform.position = posicao; Plataformas [PoolingCOunter].GetComponent <Text> ().text = Texto; Vector3 TamanhoHitbox = Plataformas [PoolingCOunter].GetComponent <BoxCollider2D> ().size; TamanhoHitbox.x = Texto.Length * 0.0065f; Plataformas [PoolingCOunter].GetComponent <BoxCollider2D> ().size = TamanhoHitbox; Plataformas [PoolingCOunter].GetComponent <JumpTest> ().IsChoice = false; } }
public void SpawnChoicePlatform(string Texto, int ChoiceID) { if (Plataformas.Count < PoolingLimit) { GameObject GO; GO = Instantiate(PlatformPrefab, transform); GO.transform.position = Fontes[ChoiceID].transform.position; Plataformas.Add(GO); Text TextoDaPlatforma; TextoDaPlatforma = GO.GetComponentInChildren <Text> (); TextoDaPlatforma.text = Texto; Vector3 TamanhoHitbox = GO.GetComponent <BoxCollider2D> ().size; TamanhoHitbox.x = Texto.Length * 0.0065f; GO.GetComponent <BoxCollider2D> ().size = TamanhoHitbox; GO.GetComponent <JumpTest> ().IsChoice = true; GO.GetComponent <JumpTest> ().ChoiceSlot = ChoiceID; } else { PoolingCOunter++; if (PoolingCOunter > PoolingLimit - 1) { PoolingCOunter = 0; } Plataformas [PoolingCOunter].transform.position = Fontes[ChoiceID].transform.position; Plataformas [PoolingCOunter].GetComponent <Text> ().text = Texto; Vector3 TamanhoHitbox = Plataformas [PoolingCOunter].GetComponent <BoxCollider2D> ().size; TamanhoHitbox.x = Texto.Length * 0.0065f; Plataformas [PoolingCOunter].GetComponent <BoxCollider2D> ().size = TamanhoHitbox; Plataformas [PoolingCOunter].GetComponent <JumpTest> ().IsChoice = true; Plataformas [PoolingCOunter].GetComponent <JumpTest> ().ChoiceSlot = ChoiceID; } }
public void ChangeNameTagDisplay(bool isShowing) { GO.GetComponentInChildren <TextMesh>(true).gameObject.SetActive(isShowing); }