public virtual void OnSelected() { CursorBehaviour cursor = GameObject.FindGameObjectWithTag("Cursor").GetComponent <CursorBehaviour>(); cursor.transform.localScale = Vector3.one * radius; cursor.SetImageToCrosshair(); }
public virtual void OnDeselect() { CursorBehaviour cursor = GameObject.FindGameObjectWithTag("Cursor").GetComponent <CursorBehaviour>(); cursor.SetImageToCursor(); cursor.transform.localScale = Vector3.one; }
public BlockController(ExperimentTask task, int blockId, TargetBehaviour[] targets, IBlockListener listener, CursorBehaviour theCursor) { this.task = task; this.blockId = blockId; this.targets = targets; this.listener = listener; this.cursor = theCursor; }
private void Update() { //If the title screen is active, move using the up/down and WS keys. if (titleScreen.activeInHierarchy) { //Activate the title screen cursor and deactivate the level select cursor -- ran when the title screen loads. if (!titleScreenCursor.IsActive()) { titleScreenCursor.SetActive(); } if (levelSelectionCursor.IsActive()) { levelSelectionCursor.Deactivate(); } //Move to the next or previous cursor. if (Input.GetKeyDown("down") || Input.GetKeyDown("s")) { titleScreenCursor = titleScreenCursor.ActivateNext(); titleScreenIndex = titleScreenCursor.GetIndex(); } else if (Input.GetKeyDown("up") || Input.GetKeyDown("w")) { titleScreenCursor = titleScreenCursor.ActivatePrevious(); titleScreenIndex = titleScreenCursor.GetIndex(); } //Activating menus } else if (levelSelectionScreen.activeInHierarchy) { //Activate the level selection screen cursor and deactivate the level select cursor -- ran when the level selection screen loads. if (!levelSelectionCursor.IsActive()) { levelSelectionCursor.SetActive(); } if (titleScreenCursor.IsActive()) { titleScreenCursor.Deactivate(); } //Move to the next or previous cursor. if (Input.GetKeyDown("right") || Input.GetKeyDown("d")) { levelSelectionCursor = levelSelectionCursor.ActivateNext(); levelSelectionIndex = levelSelectionCursor.GetIndex(); } else if (Input.GetKeyDown("left") || Input.GetKeyDown("a")) { levelSelectionCursor = levelSelectionCursor.ActivatePrevious(); levelSelectionIndex = levelSelectionCursor.GetIndex(); } } HandleSelection(); }
public TrialController(int theTrialId, TargetBehaviour initialTarget, TargetBehaviour finalTarget, ITrialListener theListener, CursorBehaviour theCursor, TrialMeasurements lastTrial) { this.trialId = theTrialId; this.initialTarget = initialTarget; this.finalTarget = finalTarget; this.listener = theListener; this.cursor = theCursor; _lastTrial = lastTrial; InitializeTrial(); }
// Called from Canvas/SkillManager EventTrigger public void ShootSkill() { if (selectedSkill == null) { return; } selectedSkill.Shoot(CursorBehaviour.GetWorldPosition()); selectedSkill.OnDeselect(); selectedSkill = null; }
void Awake() { controller = GetComponent <CharacterController2D>(); cursor = GetComponent <CursorBehaviour>(); tools = GetComponentsInChildren <ToolBehaviour>(true); respawn = GetComponent <RespawnableObject>(); textDialogs = GetComponentInChildren <TextDialogs>(); gameManager = GameManager.Instance; mainCamera = Camera.main; }
private void CreateCursor(Window window) { CursorBehaviour behaviour = null; #if WINDOWS || LINUX behaviour = new FreeCursorBehaviour(window, new Vector2(0f, 0f), new Vector2(1f, 1f)); #elif ANDROID || IOS || WINDOWSPHONE // TODO: aseta touch cursor. #endif cursor = new GuiCursor(behaviour, new EmptyRenderer()); }
// Use this for initialization public void Start() { mover = GetComponent <CharacterMover>(); match = GameObject.Find("PhotonNetman").GetComponent <Match>(); pman = GetComponent <PlayerManager>(); crosshair = GameObject.Find("CursorController").GetComponent <CursorBehaviour>(); // disable this if there is no match runnig at the moment if (!match.IsRunning()) { Debug.Log("Wait for Match to start!"); enabled = false; } transform.LookAt(Vector3.zero); }
public TestController(ITestListener listener, Text statusText, CursorBehaviour cursor, GameObject baseTarget, Transform targetPlane, ExperimentConfiguration configuration, int currentSequence) { this.testListener = listener; this.statusText = statusText; this.cursor = cursor; this.baseTarget = baseTarget; this.targetPlane = targetPlane; this.configuration = configuration; if (currentSequence < 0 || currentSequence >= configuration.GetSequences().Count) { currentSequence = configuration.GetSequences().Count - 1; } this.currentSequence = configuration.GetSequences()[currentSequence]; }
void Update() { if (cursor == null) { cursor = CursorBehaviour.allCursors[listener.playerId]; ToggleVisibility(hasJoinedTheGame); } if (!hasMadeSelection && cursor.currentTarget != null) { if (cursor.currentTarget.GetComponent <CharacterBox>() == null) { return; } Characters currentCharacter = cursor.currentTarget.GetComponent <CharacterBox> ().character; currentSelectionDisplay.sprite = Assets.Get(currentCharacter).uiInfo.bigSprite; currentSelectionDisplay.color = new Color(1f, 1f, 1f, 0.5f); CharacterBlueprint blueprint = Assets.Get(currentCharacter); currentSelectionName.text = blueprint.name; } }
public virtual void OnCursorOver(CursorBehaviour cursor) { //Debug.Log("Over"); CursorOverEvent.Invoke(cursor); }
public virtual void OnCursorBButton(CursorBehaviour cursor) { //Debug.Log("B"); CursorBButtonEvent.Invoke(cursor); }
public virtual bool IsCollidingWith(CursorBehaviour cursor) { return(false); }
public TappingTrialController(int theTrialId, TargetBehaviour initialTarget, TargetBehaviour finalTarget, ITrialListener theListener, CursorBehaviour theCursor, TrialMeasurements lastTrial) : base(theTrialId, initialTarget, finalTarget, theListener, theCursor, lastTrial) { }
public virtual void OnExit(CursorBehaviour cursor) { }
public override bool IsCollidingWith(CursorBehaviour cursor) { return(BoundingBox.CheckOverlap(cursor.col.box, box)); }
public GuiCursor(CursorBehaviour behaviour, CursorRenderer renderer) { this.behaviour = behaviour; this.renderer = renderer; }
/** DestroyGUIStatus, public void method * This method is launched by the StatusBase when the Status is Destroyed. **/ public void DestroyGUIStatus() { _CDText.text = ""; CursorBehaviour.CancelTooltip(); Destroy(gameObject); }
/** MouseEnter, public void Method * This Method is launched with an event trigger when the mouse enters the spell icon on the screen **/ public void MouseEnter() { CursorBehaviour.DisplayTooltip(Displayable); }
public DragTestController(int theTrialId, TargetBehaviour initialTarget, TargetBehaviour finalTarget, ITrialListener theListener, CursorBehaviour theCursor, TrialMeasurements lastTrial) : base(theTrialId, initialTarget, finalTarget, theListener, theCursor, lastTrial) { draggableObject = Object.Instantiate(initialTarget.gameObject); var targetBehaviour = draggableObject.GetComponent <TargetBehaviour>(); targetBehaviour.UnhighlightTarget(); targetBehaviour.SetAsDraggableTarget(); Object.Destroy(targetBehaviour); draggableObject.transform.SetParent(cursor.transform); draggableObject.transform.localPosition = Vector3.zero; draggableObject.SetActive(false); }
public virtual void OnOver(CursorBehaviour cursor) { }
public override void OnExit(CursorBehaviour cursor) { border.color = new Color32(0, 0, 0, 0); }
public override void OnEnter(CursorBehaviour cursor) { border.color = cursor.GetComponent <Image>().color; }
public virtual void OnCursorExit(CursorBehaviour cursor) { //Debug.Log("Exit"); CursorExitEvent.Invoke(cursor); }
/** MouseExit, public void Method * This Method is launched with an event trigger when the mouse exits the spell icon on the screen **/ public void MouseExit() { CursorBehaviour.CancelTooltip(); }
public CursorSelectionTechniqueDwell(float dwellTimeInSeconds, CursorBehaviour cursor) { this.dwellTimeInSeconds = dwellTimeInSeconds; this.cursor = cursor; this.cursor.RegisterNewListener(this); }
public virtual void OnBButton(CursorBehaviour cursor) { }