コード例 #1
0
 private void OnMouseDown()
 {
     if (BoardBehaviour.GetUIState() == UIState.TARGETING)
     {
         if (state == CardState.SLOT)
         {
             BoardBehaviour.SelectTarget(gameObject);
             BoardBehaviour.SetUIState(UIState.ACTION);
         }
     }
 }
コード例 #2
0
 private void OnMouseDown()
 {
     if (BoardBehaviour.GetUIState() != UIState.TARGETING && BoardBehaviour.GetUIState() != UIState.SLOT_TARGETING && BoardBehaviour.IsCurrentPlayerAction())
     {
         NetworkController.Instance.PlayerAttackWithSlot(BoardBehaviour.LocalPlayerName,SlotId,SlotId);
     }
     if (BoardBehaviour.GetUIState() == UIState.SLOT_TARGETING)
     {
         NetworkController.Instance.SelectSlotEmit(BoardBehaviour.LocalPlayerName,Pob.PlayerName,SlotId);
         BoardBehaviour.SetUIState(UIState.ACTION);
     }
 }
コード例 #3
0
    private void OnMouseOver()
    {
        if (!mouseHovering && !isExpanding && BoardBehaviour.GetUIState() != UIState.BATTLING && canMouseHover)
        {
            gameObject.transform.position = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, -2f);
            mouseHovering = true;
        }

        if (Input.GetAxis("Mouse ScrollWheel") > 0f)
        {
            gameObject.transform.DOMove(new Vector3(0f, 0f, -2f), GameConfig.F("CARD_EXPAND_TIME")).SetEase(Ease.OutCubic);
            gameObject.transform.DOScale(GameConfig.F("CARD_EXPAND_SCALE"), GameConfig.F("CARD_EXPAND_TIME")).SetEase(Ease.OutCubic);
            isExpanding = true;
        }
        if (Input.GetAxis("Mouse ScrollWheel") < 0f)
        {
            gameObject.transform.DOMove(originPos, GameConfig.F("CARD_EXPAND_TIME")).SetEase(Ease.OutCubic);
            gameObject.transform.DOScale(1f, GameConfig.F("CARD_EXPAND_TIME")).SetEase(Ease.OutCubic);
            isExpanding = false;
        }
    }