Example #1
0
 private void Update()
 {
     if (this.GetComponent <Bird>().Fly)
     {
         if (Input.GetMouseButtonDown(0))
         {
             _Finger.SetActive(true);
             thisPosition = this.transform.position;
             FingerPositions.Instance.DefaultScale();
             cameraPos = CameraFollow.Instance.CameraThisPosition();
         }
         if (Input.GetMouseButton(0))
         {
             this.gameObject.GetComponent <Rigidbody2D>().isKinematic = true;
             CameraFollow.Instance.CameraPos(cameraPos);
             this.transform.position = thisPosition;
             FingerPositions.Instance.Scales(Vector2.Distance(FingerPositions.Instance.ThisPosition(), thisPosition));
         }
         else
         {
             this.gameObject.GetComponent <Rigidbody2D>().isKinematic = false;
         }
         if (Input.GetMouseButtonUp(0))
         {
             this.gameObject.GetComponent <Bird>().Attack = true;
             AddForcePos = thisPosition - FingerPositions.Instance.ThisPosition();
             Instance.AddForces(AddForcePos * Speed);
             this.gameObject.GetComponent <Rigidbody2D>().AddForce(Vector2.zero);
             FingerPositions.Instance.Actives(false);
         }
     }
 }