private void OnMinimapTileDone(object sender, EventArgs e) { MinimapTileReadyArgs args = (MinimapTileReadyArgs)e; // Ensure we're using the correct runner. if (args.RunnerIndex != buildRunnerIndex) { return; } if (canvas == null) { int sizeX = (args.Bounds.HighX - args.Bounds.LowX) + 1; int sizeY = (args.Bounds.HighY - args.Bounds.LowY) + 1; canvas = new MapCanvas(sizeX, sizeY); } int posX = (args.Position.X - args.Bounds.LowX) * 256; int posY = (args.Position.Y - args.Bounds.LowY) * 256; canvas.DrawToCanvas(args.Image, posX, posY); UI_Map.Invalidate(); tileDone++; if (tileTotal > tileDone) { UI_TileDisplay.Text = string.Format(Constants.MAP_VIEWER_TILE_STATUS, tileDone, tileTotal); } else { UI_TileDisplay.Hide(); UI_ExportTip.Show(); } }
// Start is called before the first frame update void Awake() { localCaseData.caseName = gameObject.name; _gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); _ui = GameObject.Find("UI").GetComponent <UI_Map>(); _choice1Button = GameObject.Find("Choix1_Image").GetComponent <Button>(); _choice2Button = GameObject.Find("Choix2_Image").GetComponent <Button>(); _choice3Button = GameObject.Find("Choix3_Image").GetComponent <Button>(); }
void Start() { menu = GameObject.Find("Menu").GetComponent <UI_Map>(); tHud = transform.GetChild(0).GetComponent <TroopHUD>(); regionT = GameObject.Find("Regions").transform; for (int count = 0; count < 5; count++) { memberHealth[count] = memberMaxHealth; } }
private void UI_Map_MouseMove(object sender, MouseEventArgs e) { if (isMovingMap) { drawOffsetX = lastOffsetX + (e.X - mouseStartX); drawOffsetY = lastOffsetY + (e.Y - mouseStartY); // ToDo: Prevent scrolling out of bounds here. UI_Map.Invalidate(); } }
void Awake() { if (!i) { i = this; } else { Debug.LogError(this + " : THERE ARE MULTIPLE INSTANCES OF THIS SCRIPT"); Destroy(this); } }
private void UI_FileList_AfterSelect(object sender, TreeViewEventArgs e) { TreeNode selected = UI_FileList.SelectedNode; if (selected != null) { // Clean up previous excursions. TerminateRunners(); // Terminate runners that be running. if (canvas != null) { canvas.Dispose(); } canvas = null; overlay.ClearPoints(); UI_PreviewStatus.Hide(); UI_Map.Invalidate(); UI_ExportButton.Enabled = true; UI_ExportImageButton.Enabled = true; drawOffsetX = lastOffsetX = 0; drawOffsetY = lastOffsetY = 0; // Detatch mouse control (this shouldn't ever be an issue, really). isMovingMap = false; string mapName = selected.Text; selectedMapName = mapName; tileTotal = maps[mapName].Count; tileDone = 0; UI_TileDisplay.Text = string.Format(Constants.MAP_VIEWER_TILE_STATUS, 0, 0); UI_TileDisplay.Show(); UI_ExportTip.Hide(); buildRunner = new RunnerBuildMinimap(maps[mapName].ToArray()); buildRunnerIndex = buildRunner.Index; buildRunner.Begin(); } }
void Awake() { //Find Players playerA = GameObject.Find("Player A"); playerB = GameObject.Find("Player B"); //Player GameObject target = (player) ? playerB : playerA; //Get Components cam = Camera.main.GetComponent <CameraControl>(); menu = GameObject.Find("UI/Map").GetComponent <UI_Map>(); //Setup Components menu.Setup(target.GetComponent <PlayerCore>()); //Mark as active activePlayer = target; }
private void UI_Map_MouseDown(object sender, MouseEventArgs e) { if (Control.ModifierKeys.HasFlag(Keys.Shift)) { int pointX = e.Location.X - drawOffsetX; int pointY = e.Location.Y - drawOffsetY; pointX -= pointX % 256; pointY -= pointY % 256; overlay.ToggleOverlay(new Point(pointX, pointY)); UI_Map.Invalidate(); } else { isMovingMap = true; mouseStartX = e.X; mouseStartY = e.Y; } }
private void MapViewerWindow_ResizeEnd(object sender, EventArgs e) { UI_Map.Invalidate(); }
void Start() { menu = GameObject.Find("HUD/Menu").GetComponent <UI_Map>(); ownedUnit = new OwnedUnit(); }
void Start() { menuRoot = GameObject.Find("HUD").transform; canvas = GetComponent <CanvasGroup>(); menu = menuRoot.GetChild(1).GetComponent <UI_Map>(); }
void Start() { _ui = GameObject.Find("UI").GetComponent <UI_Map>(); }