示例#1
0
 private void Update()
 {
     if (isRun == false)
     {
         return;
     }
     if (isCompleteSketching == false && GameplayController.Instance.isEndGame == false)
     {
         if (typeLine.Equals(TypeLineFind.vertical))
         {
             scaleCur.y += GameConfig.SPEED_SCALE * Time.deltaTime * dir;
             if (Mathf.Abs(scaleCur.y) >= Mathf.Abs((posTarget.y - transform.position.y) / 100.0f))
             {
                 scaleCur.y  = (posTarget.y - transform.position.y) / 100.0f;
                 posTarget.y = MathfExtension.FloorToIntAbs(posTarget.y);
                 CompleteSketching(posTarget);
             }
         }
         else if (typeLine.Equals(TypeLineFind.horizontal))
         {
             scaleCur.x += GameConfig.SPEED_SCALE * Time.deltaTime * dir;
             if (Mathf.Abs(scaleCur.x) >= Mathf.Abs((posTarget.x - transform.position.x) / 100.0f))
             {
                 scaleCur.x  = (posTarget.x - transform.position.x) / 100.0f;
                 posTarget.x = MathfExtension.FloorToIntAbs(posTarget.x);
                 CompleteSketching(posTarget);
             }
         }
         transform.localScale = scaleCur;
     }
 }
示例#2
0
 public ItemLineInfo(Vector2 point, TypeLine typeLine)
 {
     this.point    = point;
     this.point.x  = MathfExtension.FloorToIntAbs(point.x);
     this.point.y  = MathfExtension.FloorToIntAbs(point.y);
     this.typeLine = typeLine;
 }