Ejemplo n.º 1
0
    public virtual void OnSelected()
    {
        CursorBehaviour cursor = GameObject.FindGameObjectWithTag("Cursor").GetComponent <CursorBehaviour>();

        cursor.transform.localScale = Vector3.one * radius;
        cursor.SetImageToCrosshair();
    }
Ejemplo n.º 2
0
    public virtual void OnDeselect()
    {
        CursorBehaviour cursor = GameObject.FindGameObjectWithTag("Cursor").GetComponent <CursorBehaviour>();

        cursor.SetImageToCursor();
        cursor.transform.localScale = Vector3.one;
    }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 6
0
    // Called from Canvas/SkillManager EventTrigger
    public void ShootSkill()
    {
        if (selectedSkill == null)
        {
            return;
        }

        selectedSkill.Shoot(CursorBehaviour.GetWorldPosition());
        selectedSkill.OnDeselect();
        selectedSkill = null;
    }
Ejemplo n.º 7
0
    void Awake()
    {
        controller  = GetComponent <CharacterController2D>();
        cursor      = GetComponent <CursorBehaviour>();
        tools       = GetComponentsInChildren <ToolBehaviour>(true);
        respawn     = GetComponent <RespawnableObject>();
        textDialogs = GetComponentInChildren <TextDialogs>();
        gameManager = GameManager.Instance;

        mainCamera = Camera.main;
    }
Ejemplo n.º 8
0
        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());
        }
Ejemplo n.º 9
0
    // 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);
    }
Ejemplo n.º 10
0
    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];
    }
Ejemplo n.º 11
0
    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;
        }
    }
Ejemplo n.º 12
0
 public virtual void OnCursorOver(CursorBehaviour cursor)
 {
     //Debug.Log("Over");
     CursorOverEvent.Invoke(cursor);
 }
Ejemplo n.º 13
0
 public virtual void OnCursorBButton(CursorBehaviour cursor)
 {
     //Debug.Log("B");
     CursorBButtonEvent.Invoke(cursor);
 }
Ejemplo n.º 14
0
 public virtual bool IsCollidingWith(CursorBehaviour cursor)
 {
     return(false);
 }
Ejemplo n.º 15
0
 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)
 {
 }
Ejemplo n.º 17
0
 public override bool IsCollidingWith(CursorBehaviour cursor)
 {
     return(BoundingBox.CheckOverlap(cursor.col.box, box));
 }
Ejemplo n.º 18
0
 public GuiCursor(CursorBehaviour behaviour, CursorRenderer renderer)
 {
     this.behaviour = behaviour;
     this.renderer  = renderer;
 }
Ejemplo n.º 19
0
 /** 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);
 }
Ejemplo n.º 20
0
 /** 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);
 }
Ejemplo n.º 21
0
    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)
 {
 }
Ejemplo n.º 23
0
 public override void OnExit(CursorBehaviour cursor)
 {
     border.color = new Color32(0, 0, 0, 0);
 }
Ejemplo n.º 24
0
 public override void OnEnter(CursorBehaviour cursor)
 {
     border.color = cursor.GetComponent <Image>().color;
 }
Ejemplo n.º 25
0
 public virtual void OnCursorExit(CursorBehaviour cursor)
 {
     //Debug.Log("Exit");
     CursorExitEvent.Invoke(cursor);
 }
Ejemplo n.º 26
0
 /** 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)
 {
 }