예제 #1
0
        public void OnEndDrag(PointerEventData e)
        {
            //タイルの取得
            var tile = GameObject.FindGameObjectsWithTag("Tile")
                       .Where(x => RectTransformUtility.RectangleContainsScreenPoint(x.GetComponent <RectTransform>(), e.position) == true &&
                              x.GetComponent <ETile>().isAttachable == true)
                       .Select(x => x.GetComponent <ETile>())
                       .FirstOrDefault();

            //タイル外
            if (tile == null)
            {
                rectTransform.position = oldPosition;
                return;
            }
            //他キャラクターの取得
            var otherTile = GameObject.FindGameObjectsWithTag("Edit/Character")
                            .Where(x => x.GetComponent <ECharacterIcon>().vect2D == tile.vect)
                            .FirstOrDefault();

            //既にいる
            if (otherTile != null)
            {
                rectTransform.position = oldPosition;
                return;
            }


            rectTransform.position = CSTransform.CopyVector3(tile.GetComponent <RectTransform>().position);
            oldPosition            = CSTransform.CopyVector3(rectTransform.position);
            vect2D = tile.vect;
        }
예제 #2
0
    //タイルの上に移動
    void SetPositionOnTile()
    {
        var tilePosition = BattleStage.Instance.GetTile(positionArray).transform.position;

        CSTransform.SetX(transform, tilePosition.x);
        CSTransform.SetZ(transform, tilePosition.z);
    }
예제 #3
0
        //タイルの上に移動
        void SetPositionOnTile()
        {
            var tilePosition = BBattleStage.Instance.GetTileXAndZPosition(positionArray);

            CSTransform.SetX(transform, tilePosition.x);
            CSTransform.SetZ(transform, tilePosition.y);
        }
예제 #4
0
 protected double TransformX(double source)
 {
     if (CSTransform == null)
     {
         return(0);
     }
     return(CSTransform.Transform(new Point(source, 0)).X + AxisShift);
 }
예제 #5
0
 protected double TransformY(double source)
 {
     if (CSTransform == null)
     {
         return(0);
     }
     return(CSTransform.Transform(new Point(0, source)).Y + AxisShift);
 }
예제 #6
0
        //攻撃時カメラ追従
        void OnDraggingInAttackMode(DragInfo dragInfo)
        {
            if (activeCharacter.IsNowAction() == false)
            {
                return;
            }
            //x方向
            var moveVect = GetMoveDirection(dragInfo.delta);

            CSTransform.SetX(transform, transform.position.x - moveVect.x);
            CSTransform.SetZ(transform, transform.position.z - moveVect.y);
        }
예제 #7
0
 void Update()
 {
     // 自分自身の座標に、targetの座標に相対座標を足した値を設定する
     CSTransform.SetX(transform, target.position.x + offset.x);
 }
예제 #8
0
 void Clamp()
 {
     CSTransform.SetX(transform, Mathf.Clamp(transform.position.x, -x, x));
 }
예제 #9
0
파일: CS2d.cs 프로젝트: M-Coast/MathGraph
 private void TestDrawALine(DrawingContext drawingContext)
 {
     drawingContext.DrawLine(new Pen(new SolidColorBrush(Colors.Red), 1), CSTransform.Transform(new Point(0, 0)), CSTransform.Transform(new Point(80, 50)));
 }
예제 #10
0
 public void OnDrag(PointerEventData e)
 {
     rectTransform.position = CSTransform.CopyVector3(e.position);
 }
예제 #11
0
 public void OnBeginDrag(PointerEventData e)
 {
     rectTransform.position = CSTransform.CopyVector3(e.position);
     //obj.SetAsFirstSibling();
 }
예제 #12
0
 // Use this for initialization
 void Start()
 {
     vect2D        = new IntVect2D(IntVect2D.nullNumber, IntVect2D.nullNumber);
     rectTransform = GetComponent <RectTransform>();
     oldPosition   = CSTransform.CopyVector3(rectTransform.position);
 }