public void Initialize() { foreach (GameObject g in GameObject.FindGameObjectsWithTag("Player")) { if (g.GetComponent<MouseController>() != null) { mouseController = g.GetComponent<MouseController>(); mouseLook1 = g.GetComponent<MouseLook>(); } } mouseLook2 = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<MouseLook>(); //tempCrossHairTexture = mouseController.crosshairTexture; interactLabel = mouseController.interactLabel; }
// Use this for initialization void Start () { if (Instance == null) { Instance = this; } else { Debug.LogError("Only one instance of MouseControl can be created"); } currTileUnderMouse = new Vector2(-1, -1); lastTileUnderMouse = currTileUnderMouse; groundLM = LayerMask.GetMask("Ground"); selectableLM = LayerMask.GetMask("Selectable"); }
protected override void Start() { try { if (_started) return; base.Start(); var parent = transform.parent; MouseController = parent.GetComponent<MouseController>(); TapController = parent.GetComponent<TapController>(); CurrentEffect = DamageEffect.None; damageAnimation.renderer.enabled = false; damageAnimation.Stop(); _started = true; } catch (Exception e) { LogHandler.Handle(e); } }
public FluentInvoker RightUp() { MouseController.RightUp(); return(this); }
public FluentInvoker LeftUp() { MouseController.LeftUp(); return(this); }
/// <summary> /// moves to (o), presses left, moves to (d), releases left /// </summary> /// <param name="o">From</param> /// <param name="d">To</param> public FluentInvoker DragDrop(Point o, Point d) { MouseController.DragDrop(o, d).Wait(); return(this); }
/// <summary> /// moves to (o), presses left, moves to (d), releases left /// </summary> /// <param name="ox">From x</param> /// <param name="oy">From y</param> /// <param name="dx">To x</param> /// <param name="dy">To y</param> public FluentInvoker DragDrop(int ox, int oy, int dx, int dy) { MouseController.DragDrop(ox, oy, dx, dy).Wait(); return(this); }
public void Update( MouseController MouseController, KeyController KeyController, int DeltaT, Transform Transform) { }
public bool GetButtonUp(MouseController.eMouseButtonId buttonId) { return GetButtonUp((BaseController.eButtonId)buttonId); }
private PlayerGameController() { keyboardController = KeyboardController.GetInstance(); mouseController = MouseController.GetInstance(); }
/// <summary> /// Moves, presses key down, waits for given time and releases the key up. /// </summary> /// <param name="aPoint"></param> /// <param name="aWaitPeriod">The time to wait between the press down and up</param> /// <param name="btn">Which button to click</param> /// <returns></returns> public FluentInvoker MoveClickHold(Point aPoint, TimeSpan aWaitPeriod, MouseButton btn = MouseButton.Left) { MouseController.MoveClickHold(aPoint, aWaitPeriod, btn).Wait(); return(this); }
public FluentInvoker MoveClick(Point aPoint, MouseButton btn = MouseButton.Left) { MouseController.MoveClick(aPoint, btn).Wait(); return(this); }
/// <summary> /// Moves and clicks. /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="btn">The specific button to click</param> /// <returns></returns> public FluentInvoker MoveClick(int x, int y, MouseButton btn = MouseButton.Left) { MouseController.MoveClick(x, y, btn).Wait(); return(this); }
/// <summary> /// Moves cursor in a given velocity, relativly to current position, higher is faster (log-n). /// </summary> /// <param name="aDisplacement"></param> /// <param name="aMovementVelocityLogFactor"> higher is faster (log-n).</param> public FluentInvoker MoveRelative(Point aDisplacement, double aMovementVelocityLogFactor = 2) { MouseController.MoveRelative(aDisplacement, aMovementVelocityLogFactor).Wait(); return(this); }
/// <summary> /// Moves cursor in a given velocity, higher is faster (log-n). /// </summary> /// <param name="destination"></param> /// <param name="aMovementVelocityLogFactor"> higher is faster (log-n).</param> public FluentInvoker Move(Point destination, double aMovementVelocityLogFactor = 1) { MouseController.Move(destination, aMovementVelocityLogFactor).Wait(); return(this); }
/// <summary> /// Moves cursor in a given velocity, higher is faster (log-n). /// </summary> /// <param name="dx"></param> /// <param name="dy"></param> /// <param name="aMovementVelocityLogFactor"> higher is faster (log-n).</param> public FluentInvoker Move(int dx, int dy, double aMovementVelocityLogFactor = 1) { MouseController.Move(dx, dy, aMovementVelocityLogFactor).Wait(); return(this); }
public FluentInvoker MiddleUp() { MouseController.MiddleUp(); return(this); }
/// <summary> /// Double clicks, by default - left button /// </summary> public FluentInvoker DoubleClick(MouseButton btn = MouseButton.Left) { MouseController.DoubleClick(btn).Wait(); return(this); }
// Use this for initialization void Start() { this.gameObject.layer = 2; this.gameObject.tag = "Building"; this.id = _buildingID_++; this.state = BuildingState.PREBUILD; this._collider = this.GetComponent<Collider>(); this._collider.isTrigger = true; this._mouseController = GameObject.FindObjectOfType<MouseController>().GetComponent<MouseController>(); this._handController = GameObject.FindObjectOfType<HandController>().GetComponent<HandController>(); this._renderer = this.GetComponent<MeshRenderer>(); this._originalColor = this._renderer.material.color; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here Global.Content = Content; // Allow mouse //IsMouseVisible = true; cursor = CustomCusor.GetInstance(); // Initialize map gridMap = WordGrid.GetInstance(); //gridMap.Load(Content.Load<GridData>(Utils.GetMapFileName(Consts.DEFALT_MAP_NAME))); // Initialize dictionary dictionary = TrieDictionary.GetInstance(); dictionary.Load(Content.Load<string[]>(Utils.GetDictionaryFileName(Consts.DEFAULT_DICTIONARY_NAME))); // Initialize logo panel logoPanel = LogoPanel.GetInstance(); // Initialize menu menuContainer = MenuContainer.GetInstance(); // Initialize background background = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName("Background"))); // Initialize notification notification = GameNotification.GetInstance(); // Initialize controller mouseController = MouseController.GetInstance(); keyboardController = KeyboardController.GetInstance(); // Initialize button backButton = new TileButton(25, 620, Utils.GetImageFileName("Back")); soundButton = new TileButton(70, 620, Utils.GetImageFileName("Sound")); // Load sound effects Global.clickSound = Content.Load<SoundEffect>(@"Sound\click"); Global.achieveSound = Content.Load<SoundEffect>(@"Sound\achieve"); Global.themeSong = Content.Load<Song>(@"Sound\theme"); Global.UpdatePhase(Phase.MENU_LOADING); }
public void AddMouseController() { MouseController controller = new MouseController(); m_MouseControllerId = ControllerInputManager.Instance.AddController(controller); }
public FluentInvoker MiddleClick() { MouseController.MiddleClick().Wait(); return(this); }
// Use this for initialization. private void Start() { mc = WorldController.Instance.mouseController; txt = GetComponent <Text>(); }
public FluentInvoker RightClick() { MouseController.RightClick().Wait(); return(this); }
// Use this for initialization public void SetMouseController(MouseController currentMouseController) { mouseController = currentMouseController; }