// Use this for initialization void Start() { DontDestroyOnLoad(gameObject); hotbar_prefab = hotbar_ref; sprite_prefab = sprite_ref; pickup_prefab = pickup_ref; g_manager = GameObject.Find("Game Manager").GetComponent <game_manager>(); i_manager = GameObject.Find("Item Manager").GetComponent <item_manager>(); e_manager = GameObject.Find("Enemy Manager").GetComponent <enemy_manager>(); b_manager = GameObject.Find("Enemy Manager").GetComponent <boss_manager>(); p_manager = GameObject.Find("Player Manager").GetComponent <player_manager>(); perks = GameObject.Find("Player Manager").GetComponent <perk_manager>(); feature_spawner = GameObject.Find("Map Manager").GetComponent <map_feature_spawner>(); m_gen = GameObject.Find("Map Manager").GetComponent <map_generator>(); v_manager = GameObject.Find("Map Manager").GetComponent <fov_manager>(); d_manager = GameObject.Find("Dijkstra Manager").GetComponent <dijkstra_manager>(); events = GameObject.Find("Event Manager").GetComponent <event_manager>(); game_master = new rpg_character(); colors = new Color[7]; colors[0] = Color.green; colors[1] = Color.red; colors[2] = Color.blue; colors[3] = Color.cyan; colors[4] = Color.magenta; colors[5] = Color.yellow; colors[6] = Color.grey; up = new Vector2Int(0, 1); down = new Vector2Int(0, -1); left = new Vector2Int(-1, 0); right = new Vector2Int(1, 0); }
public void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { map_generator map = GameObject.Find("mapGen").GetComponent <map_generator>(); map.offset += new Vector2(16, 0); map.Generate(); GetComponent <BoxCollider2D>().enabled = false; } }
// Use this for initialization void Start() { DontDestroyOnLoad(gameObject); dungeon_map = GameObject.Find("Map Manager").GetComponent <map_generator>(); f_manager = GameObject.Find("Map Manager").GetComponent <fov_manager>(); p_manager = GameObject.Find("Player Manager").GetComponent <player_manager>(); player_distance = new int[util_ref.m_gen.x_dim, util_ref.m_gen.y_dim]; player_sight = new int[util_ref.m_gen.x_dim, util_ref.m_gen.y_dim]; enemy_location = new int[util_ref.m_gen.x_dim, util_ref.m_gen.y_dim]; init_gradient(); }