void Start() { Grid = GetComponent <s_grid>(); Grid.Initialize(); Player = GameObject.Find("player").GetComponent <o_player>(); GameObject lev = GameObject.Find("Game"); s_levelstructure l = lev.GetComponent <s_levelstructure>(); GameObject ingalev = GameObject.Find("InGame"); ing = ingalev.GetComponent <s_levelstructure>(); List <data_level> lstruct = new List <data_level>(); lstruct = l.levels; if (GameObject.Find("Position") != null) { txt = GameObject.Find("Position").GetComponent <UnityEngine.UI.Text>(); } //Copy all the data from the Editor's to the inGame's foreach (data_level da in lstruct) { ing.levels.Add(da); } levels = ing.levels; //De-references the original levels object so it dosen't get changed. l = null; LoadLevel(); }
protected void Start() { rend = GetComponent <SpriteRenderer>(); grid = GameObject.Find("Manager").GetComponent <s_grid>(); nodeleng = grid.GetNodeLength; Collider = new o_bounding_box( new Vector3(0, 0, 0), new Vector3(nodeleng, nodeleng, nodeleng)); }
void ICharacter.Intialize() { defeated = false; current_item = null; actionPoints = maxActionPoints; health = maxHealth; hasdisapeared = false; GameObject manager = GameObject.Find("Manager"); if (GameObject.Find("CharacterManager") != null) { charctMnger = GameObject.Find("CharacterManager").GetComponent <s_charactermanager>(); } renderer = GetComponent <SpriteRenderer>(); grid = manager.GetComponent <s_grid>(); path = manager.GetComponent <s_pathfind>(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); s_grid st = (s_grid)target; if (GUILayout.Button("Create Prefabs")) { st.Initialize(); } if (st.ObjectPool != null) { EditorGUILayout.LabelField("Object pooler present."); } else { EditorGUILayout.LabelField("Object pooler not present."); } }
private void Start() { if (GameObject.Find("Position") != null) { txt = GameObject.Find("Position").GetComponent <UnityEngine.UI.Text>(); } cursor = GameObject.Find("Cursor"); left_bar = GameObject.Find("<").GetComponent <Button>(); right_bar = GameObject.Find(">").GetComponent <Button>(); button = GameObject.Find("Brush").GetComponent <Button>(); load_level = GameObject.Find("Load Level").GetComponent <Button>(); inpfeild = GameObject.Find("Level Name").GetComponent <InputField>(); text = button.gameObject.transform.GetChild(0).GetComponent <Text>(); Grid = GetComponent <s_grid>(); Grid.Initialize(); currentblock = Grid.BlockTypes[0]; if (Resources.Load("Game") != null) { LevelStructureLoad(); } }
public void Start() { Grid = GetComponent <s_grid>(); }
private void Awake() { Grid = GameObject.Find("Manager").GetComponent <s_grid>(); stats = GameObject.Find("StatusText").GetComponent <Text>(); }
private void Start() { Grid = GameObject.Find("Manager").GetComponent <s_grid>(); }