void Awake() { if (instance == null) { instance = this; } }
public void Start() { //initialize properties att = GetComponent <NodeAttributes>(); sr = GetComponent <SpriteRenderer>(); tm = GameObject.FindGameObjectWithTag("tile_manager").GetComponent <TileManagerScript>(); }
// Use this for initialization void Start() { foreach (Transform tile in transform.FindChild("DisplayTiles")) { tile.FindChild("default").renderer.material = TileManagerScript.Instance().GetMaterial(int.Parse(tile.gameObject.name) - 1); } }
// Use this for initialization void Start() { tileList = TileManagerScript.Instance.goTileList; gameManager = GameObject.Find("GameManager").GetComponent <GameManagerBehaviour>(); enemySpawner = GameObject.Find("Lv1Spawner").GetComponent <SpawnEnemy1>(); tileManager = GameObject.Find("TileManagerPrefab").GetComponent <TileManagerScript>(); coreHealth = GameObject.Find("Core").GetComponent <CoreHealth>(); if (SceneManager.GetActiveScene().name == "TutorialLevel") { tutorialManager = GameObject.Find("TutorialManager").GetComponent <TutorialManager>(); } StartCoroutine(HideProgressIndicator(1.5f)); SoundManagerScript.Instance.PlaySFX(AudioClipID.SFX_PrepareforbattleStartBattle); }
void CreateTileManager() { //if there is a tile manager already in the scene, destroy it GameObject tm = GameObject.FindGameObjectWithTag(tile_manager_tag); if (tm != null) { GameObject.DestroyImmediate(tm); } //initialize the tile manager tm = new GameObject(); tm.tag = tile_manager_tag; tm.name = "tile_manager"; TileManagerScript tm_script = tm.AddComponent <TileManagerScript>(); tm_script.CreateArray(GameObject.FindGameObjectsWithTag("tile"), length, width); tm_script.length = length; tm_script.width = width; }
// Use this for initialization void Start() { keyScript = gameObject.AddComponent <KeyScript>(); tileManagerScript = gameObject.AddComponent <TileManagerScript>(); mapManagerScript = gameObject.AddComponent <MapManagerScript>(); controllScript = gameObject.AddComponent <ControllScript>(); controllScript.enabled = false; keyScript.LoadKey(); if (!mapManagerScript.IsDataFile("/mapki.dat")) { SaveMapsScript s = gameObject.AddComponent <SaveMapsScript>(); mapManagerScript.LoadMaps(s.PrepareData()); } else { mapManagerScript.LoadMaps("/mapki.dat"); } buttonAction action = SetUpGame; gameMenuScript.SetUpLevelButtons(action); gameMenuScript.UpdateLevelButtons(keyScript.GetKeyValue()); }