void Awake() { if(master == null){ //DontDestroyOnLoad(gameObject); master = this; } else if (master != this){ Destroy(this); // Destroy(gameObject); } }
private void base_MouseEnter(object sender, EventArgs e) { Image = imgSelected; Cursor = CustomCursor.Load("Default.CUR"); Sound.Play("Button\\Select.WAV"); }
void Awake() { instance = this; cursorGazeProgressBar.material.SetFloat("Progress", 0f); }
public void addCursor(CustomCursor cursor) { cursors.Add(cursor); this.guiCustomized = true; }
public void ClientSetCursor(Bitmap image, int x, int y, int width, int height) { Program.AssertOffEventThread(); if (RemoteCursor != null) RemoteCursor.Dispose(); RemoteCursor = new CustomCursor(image, x, y); Program.Invoke(this, delegate() { if (cursorOver) this.Cursor = RemoteCursor.Cursor; }); }
protected override void OnCursorChange(CefBrowser browser, IntPtr cursorHandle, CefCursorType type, CefCursorInfo customCursorInfo) { WebView.RaiseCefCursorChange( new CursorChangeEventArgs(type != CefCursorType.Custom ? CursorInteropHelper.Create(cursorHandle) : CustomCursor.Create(ref customCursorInfo), type) ); }
void Start() { cc = GameObject.Find("Cursor").GetComponent <CustomCursor>(); inv = GameObject.Find("Inventory").GetComponent <Inventory>(); puzzles = gameObject.GetComponents <PuzzleItem>(); }
private void base_MouseUp(object sender, EventArgs e) { Image = imgSelected; Cursor = CustomCursor.Load("Default.CUR"); }
private void base_MouseUp(object sender, MouseEventArgs e) { Cursor = CustomCursor.Load("Default.CUR"); string body = World.Building[BuildingID].Description + Environment.NewLine + Environment.NewLine; if (BuildingID != 0) { body += "Maintenance: " + World.Building[BuildingID].Maintenance; if (World.Building[BuildingID].Income != 0) { body += Environment.NewLine + "Income: " + World.Building[BuildingID].Income; } if (World.Building[BuildingID].AttackBonus != 0) { body += Environment.NewLine + "Attack Bonus: " + World.Building[BuildingID].AttackBonus; } if (World.Building[BuildingID].DefenceBonus != 0) { body += Environment.NewLine + "Defence Bonus: " + World.Building[BuildingID].DefenceBonus; } if (World.Building[BuildingID].RecruitmentBonus != 0) { body += Environment.NewLine + "Recruitment Bonus: " + World.Building[BuildingID].RecruitmentBonus; } if (World.Building[BuildingID].ReligionInfluence != 0) { body += Environment.NewLine + "Religion Influence: " + World.Building[BuildingID].ReligionInfluence; } } else { if (World.Region[RegionID].Type == RegionType.Capital) { body += "Income: " + World.BaseRegionIncome * 2; } else { body += "Income: " + World.BaseRegionIncome; } } if (e.Button == MouseButtons.Left) { Notice.Show(body, BuildingName, "Buildings\\" + BuildingName); } else if (e.Button == MouseButtons.Right) { if (BuildingID != 0) { if (Notice.Show( "Do you want to demolish this building?", BuildingName, "Buildings\\" + BuildingName) == DialogResult.Yes) { MessageBox.Show("Inca nu se pot sterge cladirile decat din meniu sau din consola cu 'region removebuilding <regId> <buildingId>'"); } else { Notice.Show("You cannot demolish this building!", BuildingName, "Buildings\\" + BuildingName); } } } }
public PauseState() { _customCursor = new CustomCursor(); _mouseState = Mouse.GetState(); _hud = new PauseHud(); }
private void Map_MouseUp(object sender, MouseEventArgs e) { Map.Cursor = CustomCursor.Load("Default.CUR"); }
public SettingsState() { _customCursor = new CustomCursor(); _mouseState = Mouse.GetState(); _hud = new SettingsHud(); }
// Start is called before the first frame update void Start() { camController = GameObject.Find("Cameras").GetComponent <CameraController>(); coll = gameObject.GetComponent <Collider>(); cc = GameObject.Find("Cursor").GetComponent <CustomCursor>(); }
private void base_MouseLeave(object sender, EventArgs e) { Image = imgIdle; Cursor = CustomCursor.Load("Default.CUR"); }
public override bool doTool() { cursorDeleted = adventureData.getCursors()[index]; adventureData.getCursors().RemoveAt(index); return(true); }
private void base_MouseDown(object sender, EventArgs e) { Image = imgClicked; Cursor = CustomCursor.Load("Default_Pressed.CUR"); Sound.Play("Button\\Click.WAV"); }
private void base_MouseEnter(object sender, EventArgs e) { Cursor = CustomCursor.Load("Default.CUR"); Selected = true; }
protected override void Dispose(bool disposing) { try { if (!disposing) return; Clip.ClipboardChanged -= ClipboardChanged; Disconnect(); lock (backBuffer) { frontGraphics.Dispose(); backGraphics.Dispose(); backBuffer.Dispose(); backGraphics = null; frontGraphics = null; } if (RemoteCursor != null) { RemoteCursor.Dispose(); RemoteCursor = null; } } finally { base.Dispose(disposing); } }
private void base_MouseLeave(object sender, EventArgs e) { Cursor = CustomCursor.Load("Default.CUR"); Selected = false; }
private void base_MouseUp(object sender, MouseEventArgs e) { Cursor = CustomCursor.Load("Default.CUR"); Clicked = false; }
public DefeatState() { _customCursor = new CustomCursor(); _mouseState = Mouse.GetState(); _hud = new DefeatHud(); }
static IScene SetupScene(IAssetManager assetManager) { // Create scene IScene scene = new Scene("Game"); // Create the human player PlayerController player = scene.CreateGameObject <PlayerController>("PlayerController", Vector2.Zero); { player.TeamColor = new Color(183, 68, 231); player.AttackCommandSound = assetManager.GetAsset <AudioClip>("AttackCommand"); player.AddComponent <LineRenderer>(); player.AddComponent <AudioSource>(); } // Create the AI player AIController aiPlayer = scene.CreateGameObject <AIController>("AIController", Vector2.Zero); { aiPlayer.TeamColor = new Color(68, 231, 118); } // Create the Neutral player AIController neutralPlayer = scene.CreateGameObject <AIController>("NeutralController", Vector2.Zero); { neutralPlayer.TeamColor = new Color(230, 230, 230); neutralPlayer.IsNeutral = true; } // Create the GameController GameController gc = scene.CreateGameObject <GameController>("GameController", Vector2.Zero); { gc.ShipSprite = new Sprite(assetManager.GetAsset <Texture2D>("ship")); gc.ShotSprite = new Sprite(assetManager.GetAsset <Texture2D>("bullet")); gc.OutlineSprite = new Sprite(assetManager.GetAsset <Texture2D>("outline")); gc.RangeSprite = new Sprite(assetManager.GetAsset <Texture2D>("range")); gc.PlanetConqueredSound = assetManager.GetAsset <AudioClip>("PlanetConquered"); gc.PlanetSelectSound = assetManager.GetAsset <AudioClip>("PlanetSelect"); gc.PlanetUpgradeSound = assetManager.GetAsset <AudioClip>("PlanetUpgrade"); gc.ShipShotSound = assetManager.GetAsset <AudioClip>("ShipShotDown"); gc.ShipExplosionAnimation = new AnimationClip(new Sprite(assetManager.GetAsset <Texture2D>("ship_explosion")), 7); gc.PlanetPopulationFont = assetManager.GetAsset <Font>("main_font"); gc.Players = new Player[] { player, aiPlayer, neutralPlayer }; // Set the planet types and upgrades gc.PlanetTypes = new[] { new Planet.Type { UpgradeLevels = new[] { new Planet.Upgrade { Cost = 10, Sprite = new Sprite(assetManager.GetAsset <Texture2D>("Planet1")), PopGenerationLimit = 20, PopGenerationRate = 2f }, new Planet.Upgrade { Cost = 15, Sprite = new Sprite(assetManager.GetAsset <Texture2D>("Planet2")), PopGenerationLimit = 40, PopGenerationRate = 1.5f }, new Planet.Upgrade { Cost = 20, Sprite = new Sprite(assetManager.GetAsset <Texture2D>("Planet3")), PopGenerationLimit = 60, PopGenerationRate = 1f } } }, new Planet.Type { UpgradeLevels = new[] { new Planet.Upgrade { Cost = 10, FireRate = 0.5f, Range = 120, Sprite = new Sprite(assetManager.GetAsset <Texture2D>("Sentry1")), }, new Planet.Upgrade { Cost = 20, FireRate = 0.4f, Range = 170, Sprite = new Sprite(assetManager.GetAsset <Texture2D>("Sentry2")), }, new Planet.Upgrade { Cost = 30, FireRate = 0.3f, Range = 210, Sprite = new Sprite(assetManager.GetAsset <Texture2D>("Sentry3")), } } } }; player.GameController = gc; aiPlayer.GameController = gc; } // Create the Custom Cursor CustomCursor cc = scene.CreateGameObject <CustomCursor>("CustomCursor", Vector2.Zero); { cc.AddComponent <SpriteRenderer>(); cc.Percent25Sprite = new Sprite(assetManager.GetAsset <Texture2D>("cursor_25")); cc.Percent50Sprite = new Sprite(assetManager.GetAsset <Texture2D>("cursor_50")); cc.Percent75Sprite = new Sprite(assetManager.GetAsset <Texture2D>("cursor_75")); cc.Percent100Sprite = new Sprite(assetManager.GetAsset <Texture2D>("cursor_100")); player.CustomCursor = cc; } // Create the HUD HUD hud = scene.CreateGameObject <HUD>("HUD", Vector2.Zero); { var leftBar = scene.CreateGameObject <LineRenderer>("LeftBar", Vector2.Zero); var rightBar = scene.CreateGameObject <LineRenderer>("RightBar", Vector2.Zero); var leftText = scene.CreateGameObject <TextRenderer>("LeftText", Vector2.Zero); var rightText = scene.CreateGameObject <TextRenderer>("RightText", Vector2.Zero); hud.LeftBar = leftBar; hud.RightBar = rightBar; hud.LeftText = leftText; hud.RightText = rightText; hud.UIFont = assetManager.GetAsset <Font>("main_font"); hud.GameController = gc; } return(scene); }