コード例 #1
0
ファイル: SkillBehaviour.cs プロジェクト: joelnl/GameJam
    public virtual void OnSelected()
    {
        CursorBehaviour cursor = GameObject.FindGameObjectWithTag("Cursor").GetComponent <CursorBehaviour>();

        cursor.transform.localScale = Vector3.one * radius;
        cursor.SetImageToCrosshair();
    }
コード例 #2
0
ファイル: SkillBehaviour.cs プロジェクト: joelnl/GameJam
    public virtual void OnDeselect()
    {
        CursorBehaviour cursor = GameObject.FindGameObjectWithTag("Cursor").GetComponent <CursorBehaviour>();

        cursor.SetImageToCursor();
        cursor.transform.localScale = Vector3.one;
    }
コード例 #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;
 }
コード例 #4
0
    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();
    }
コード例 #5
0
 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();
 }
コード例 #6
0
ファイル: SkillManager.cs プロジェクト: joelnl/GameJam
    // Called from Canvas/SkillManager EventTrigger
    public void ShootSkill()
    {
        if (selectedSkill == null)
        {
            return;
        }

        selectedSkill.Shoot(CursorBehaviour.GetWorldPosition());
        selectedSkill.OnDeselect();
        selectedSkill = null;
    }
コード例 #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;
    }
コード例 #8
0
ファイル: WindowManager.cs プロジェクト: siquel/BeatEmUp
        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());
        }
コード例 #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);
    }
コード例 #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];
    }
コード例 #11
0
ファイル: PlayerBox.cs プロジェクト: ChrisDayGames/New-Koth
    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;
        }
    }
コード例 #12
0
 public virtual void OnCursorOver(CursorBehaviour cursor)
 {
     //Debug.Log("Over");
     CursorOverEvent.Invoke(cursor);
 }
コード例 #13
0
 public virtual void OnCursorBButton(CursorBehaviour cursor)
 {
     //Debug.Log("B");
     CursorBButtonEvent.Invoke(cursor);
 }
コード例 #14
0
ファイル: UICollider.cs プロジェクト: ChrisDayGames/New-Koth
 public virtual bool IsCollidingWith(CursorBehaviour cursor)
 {
     return(false);
 }
コード例 #15
0
 public TappingTrialController(int theTrialId, TargetBehaviour initialTarget, TargetBehaviour finalTarget, ITrialListener theListener, CursorBehaviour theCursor, TrialMeasurements lastTrial)
     : base(theTrialId, initialTarget, finalTarget, theListener, theCursor, lastTrial)
 {
 }
コード例 #16
0
 public virtual void OnExit(CursorBehaviour cursor)
 {
 }
コード例 #17
0
 public override bool IsCollidingWith(CursorBehaviour cursor)
 {
     return(BoundingBox.CheckOverlap(cursor.col.box, box));
 }
コード例 #18
0
ファイル: GuiCursor.cs プロジェクト: siquel/BeatEmUp
 public GuiCursor(CursorBehaviour behaviour, CursorRenderer renderer)
 {
     this.behaviour = behaviour;
     this.renderer  = renderer;
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
    }
コード例 #22
0
 public virtual void OnOver(CursorBehaviour cursor)
 {
 }
コード例 #23
0
 public override void OnExit(CursorBehaviour cursor)
 {
     border.color = new Color32(0, 0, 0, 0);
 }
コード例 #24
0
 public override void OnEnter(CursorBehaviour cursor)
 {
     border.color = cursor.GetComponent <Image>().color;
 }
コード例 #25
0
 public virtual void OnCursorExit(CursorBehaviour cursor)
 {
     //Debug.Log("Exit");
     CursorExitEvent.Invoke(cursor);
 }
コード例 #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);
 }
コード例 #28
0
 public virtual void OnBButton(CursorBehaviour cursor)
 {
 }