private void TestCursor(Point cursorPosition) { if (_setDragCursor != null) { _setDragCursor.Dispose(); _setDragCursor = null; } if (HitTestSizeArea(cursorPosition)) { switch (this.Dock) { case DockStyle.Left: case DockStyle.Right: _setDragCursor = new SetCursor(this, Cursors.VSplit); break; case DockStyle.Top: case DockStyle.Bottom: _setDragCursor = new SetCursor(this, Cursors.HSplit); break; default: break; } } }
private void DisposeCursor() { if (_setCursor != null) { _setCursor.Dispose(); _setCursor = null; } }
private void Awake() { try { minHitBoxSize = GameObject.FindObjectOfType <EvidenceObjectLoader>().minHitBoxSize; } catch { } gameManager = GameObject.FindObjectOfType <GameManager>(); sentences = new Queue <string>(); settingsPanel = settingsPanel != null ? settingsPanel : transform.FindNestedChildrenBFS("SettingsMenu").gameObject; cursorManagerSetCursor = GameObject.FindObjectOfType <SetCursor>(); corkBoard = GameObject.Find("CorkBoard"); playerController = GameObject.FindObjectOfType <PlayerController>(); helpDialogueController = GameObject.Find("HelpButton") != null?GameObject.Find("HelpButton").GetComponent <DialogueController>() : null; dialogueName = GameObject.Find("DialogueName"); dialogueContent = GameObject.Find("DialogueContent"); dialogueOptions = GameObject.Find("DialogueOptions"); audioManager = GameObject.FindObjectOfType <AudioManager>(); decisionController = GameObject.FindObjectOfType <DecisionController>(); // if corkboard present then on main game scene, load variables if (corkBoard != null) { foreach (string name_ in inspectionObjectNames) { inspectionObjects.Add(GameObject.Find(name_)); } foreach (string name_ in correlationObjectNames) { correlationObjects.Add(GameObject.Find(name_)); } foreach (string name_ in decisionObjectNames) { decisionObjects.Add(GameObject.Find(name_)); } // turn all objects off initially... foreach (GameObject o in inspectionObjects) { o.SetActive(false); } foreach (GameObject o in correlationObjects) { o.SetActive(false); } foreach (GameObject o in decisionObjects) { o.SetActive(false); } // then activate the current phase updateUI(gameManager.currentPhaseName); } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); if (_setDragCursor != null && !_dragHandler.Dragging) { _setDragCursor.Dispose(); _setDragCursor = null; } }
void Start() { Invoke("KnexCoolDown", 60.0f); gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); setCursor = GameObject.FindWithTag("GameController").GetComponent <SetCursor>(); // Chosen name creatureName = namePresets1[Random.Range(0, namePresets1.Length)]; if (Random.Range(0, 100) < 80) { creatureName += namePresets2[Random.Range(0, namePresets2.Length)]; } if (Random.Range(0, 100) < 60) { creatureName += namePresets3[Random.Range(0, namePresets3.Length)]; } // Chosen variables if (firstGeneration) { chosenColor = creatureColors[Random.Range(0, 8)]; chosenScale = Random.Range(30, 100); chosenStrength = Random.Range(0, 100); chosenFriendliness = Random.Range(0, 100); chosenSpeed = Random.Range(10, 100); } gameObject.GetComponent <Renderer>().material = chosenColor; gameObject.transform.localScale = new Vector3(transform.localScale.x, chosenScale, transform.localScale.z); movementSpeed = chosenSpeed / 25; nameTitle.text = creatureName; // Start movement timeBetweenActions = Random.Range(0.5f, 4.0f); currentAngle = transform.eulerAngles; InvokeRepeating("MoveCreature", timeBetweenActions, timeBetweenActions); // Birth message if (!firstGeneration) { // Debug.Log(father + " and " + mother + " just made " + creatureName); } }
protected override void Dispose(bool disposing) { if (!disposed) { Console.WriteLine("DXGameWindowCursor.Dispose .. start"); this.control = null; this.invisibleCursor = null; this.defaultCursor = null; this.setCursor = null; Console.WriteLine("DXGameWindowCursor.Dispose .. done"); base.Dispose(disposing); disposed = true; } }
public DXGameWindowCursor(Control control) { if (control == null) { throw new ArgumentNullException("control"); } this.control = control; control.MouseEnter += this.MouseEnter; control.MouseLeave += this.MouseLeave; this.defaultCursor = Cursors.Hand; this.invisibleCursor = new Cursor(new Bitmap(48, 48).GetHicon()); this.isCursorVisible = true; this.inactiveTime = new TimeSpan(); this.InvisibleTimeout = new TimeSpan(0, 0, 1); setCursor = delegate(Cursor cursor) { try { this.control.Cursor = cursor; } catch (Exception) { } }; }
private void TestCursor(Point location) { foreach (ToolStripItem item in this.Items) { if (item is ToolStripButton && item.Bounds.Contains(location)) { DisposeCursor(); return; } } DockingControl parent = Parent as DockingControl; if (parent != null && !parent.AutoHide) { if (_setCursor == null) { _setCursor = new SetCursor(this, Cursors.SizeAll); } } }
private void _dragHandler_EndSplitterDrag(SplitterDragHandler sender, int size) { switch (_dock) { case DockingType.Floating: break; case DockingType.Left: this.Width += size; _animator.TargetSize = this.Width; break; case DockingType.Right: this.Left += size; this.Width -= size; _animator.TargetSize = this.Width; break; case DockingType.Top: this.Height += size; _animator.TargetSize = this.Height; break; case DockingType.Bottom: this.Top += size; this.Height -= size; _animator.TargetSize = this.Height; break; default: break; } if (_setDragCursor != null) { _setDragCursor.Dispose(); _setDragCursor = null; } }
public void LoadContent(IsometricMapInfo mapInfo, SetCursor setCursor) { SetCursorPosition = setCursor; _tileDimensions = mapInfo.TileDimensions; _gridDimensions = mapInfo.LayerDimensions; _grid = new CombatTile[(int)GridDimensions.X, (int)GridDimensions.Y]; // Load the content for each combat tile and store it in the grid for (int y = 0; y < GridDimensions.Y; y++) { for (int x = 0; x < GridDimensions.X; x++) { _grid[x, y] = new CombatTile(); _grid[x, y].LoadContent(mapInfo.Tiles[x, y]); _grid[x, y].GridPosition = new Point(x, y); } } // Laod the tilesheet _image.Path = "Gameplay/TileSheets/ground"; _image.LoadContent(); _moveEffectRect = new Rectangle(0, 0, 32, 32); // Hardcoded, remove later }
void Start() { sc=this.transform.GetComponent<SetCursor>(); ShowMassage._instance.ClosecratePanel(); }
// Start is called before the first frame update void Start() { cursor = GameObject.FindGameObjectWithTag("CameraRotator").GetComponent <SetCursor>(); }