// Start is called before the first frame update void Start() { helper = new Helper(); player = GameObject.FindGameObjectWithTag(Constants.TAG_PLAYER); playerScript = player.GetComponent <PlayerScript>(); minimapController = GameObject.Find(Constants.GAMEOBJECT_NAME_MINIMAPCAMERA).GetComponent <MinimapController>(); levelManagerTransform = GameObject.Find(Constants.GAMEOBJECT_NAME_LEVELMANAGER).transform; itemUI = GameObject.Find(Constants.GAMEOBJECT_NAME_CANVAS).GetComponent <ItemDescriptionUI>(); items = new List <Item>(); }
private void Reveal() { // For every neighbour of the room for this minimapRoom // Get the minimapRoom for that room (not confusing at all!)' // Then just enable the Image component of that room image.enabled = true; foreach (var roomArray in RoomManager.GetRoom_ByCoordinates(Coordinates).Info.Neighbours.Values) { foreach (var room in roomArray) { var mR = MinimapController.GetMinimapRoom(room.Coordinates); if (mR != null) { MinimapController.GetMinimapRoom(room.Coordinates).image.enabled = true; } } } }
void Awake() { // connect to the outer data labyrinth = GameObject.FindGameObjectWithTag("Labyrinth").GetComponent<LabyrinthController>(); walls = labyrinth.GetMap(); minimap = GameObject.FindGameObjectWithTag("Minimap").GetComponent<MinimapController>(); // connect to subsystems laser = GetComponent<DroidLaser>(); // create first particles, for 3*3 for each unit var length = labyrinth.length; var width = labyrinth.width; var particlesOnUnit = 1; var particlesShift = CreateParticlesShift(particlesOnUnit); var ls = new List<Particle>(); for (var i = 0; i < length; i++) { for (var j = 0; j < width; j++) { if (walls[i, j] == 0) { // nine particles for every unit for (var k = 0; k < particlesOnUnit*particlesOnUnit; k++) { var particle = new Particle { probablity = 1, position = new Vector3(i, 1f, j) + particlesShift[k] }; ls.Add(particle); } } } } // create particles map particlesMap = new ParticlesMap(ls); particlesMap.Normalize(); StartCoroutine(minimap.ShowParticles(particlesMap.Particles)); }