//private void OnMouseEnter() { // foreach (AnchorNode n in _anchors.Keys) { // n.SetAnchorState(AnchorState.Debug); // } //} //private void OnMouseExit() { // foreach (AnchorNode n in _anchors.Keys) { // n.SetAnchorState(AnchorState.None); // } //} private void OnMouseOver() { if (Input.GetMouseButtonDown(1)) { List <TileNode> roomNodes = RoomAlgorithm.IsRoom(this); if (roomNodes != null && roomNodes.Count > 0) { GameObject ceillingPrefab = (GameObject)Resources.Load("Prefabs/Ceilling"); foreach (TileNode n in roomNodes) { n.GetComponent <Renderer>().material.color = Color.blue; if (ceillingPrefab != null) { if (n.transform.childCount <= 0) { Instantiate(ceillingPrefab, n.transform.position, Quaternion.identity, n.transform); } } } } } }
public static void Init() { #if GAME_MODE ItemDex = new ItemEntry[MAX_ITEMS]; for (int i = 0; i < MAX_ITEMS; i++) { ItemDex[i] = new ItemEntry(); ItemDex[i].Load(i); } MoveDex = new MoveEntry[MAX_MOVES]; for (int i = 0; i < MAX_MOVES; i++) { MoveDex[i] = new MoveEntry(); MoveDex[i].Load(i); } #endif Dex = new DexEntry[MAX_DEX+1]; for (int i = 0; i <= MAX_DEX; i++) { try { Dex[i] = new DexEntry(); Dex[i].Load(i); } catch (Exception ex) { Logs.Logger.LogError(ex); } } #if GAME_MODE RoomAlgorithmDex = new RoomAlgorithm[MAX_ROOM_ALGORITHMS]; for (int i = 0; i < MAX_ROOM_ALGORITHMS; i++) { RoomAlgorithmDex[i] = new RoomAlgorithm(); RoomAlgorithmDex[i].Load(i); } FloorAlgorithmDex = new FloorAlgorithm[MAX_FLOOR_ALGORITHMS]; for (int i = 0; i < MAX_FLOOR_ALGORITHMS; i++) { FloorAlgorithmDex[i] = new FloorAlgorithm(); FloorAlgorithmDex[i].Load(i); } DungeonAlgorithmDex = new AlgorithmEntry[MAX_DUNGEON_ALGORITHMS]; for (int i = 0; i < MAX_DUNGEON_ALGORITHMS; i++) { DungeonAlgorithmDex[i] = new AlgorithmEntry(); DungeonAlgorithmDex[i].Load(i); } RDungeonDex = new RDungeonEntry[MAX_RDUNGEONS]; for (int i = 0; i < MAX_RDUNGEONS; i++) { RDungeonDex[i] = new RDungeonEntry(); RDungeonDex[i].Load(i); } #endif }