Exemplo n.º 1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.tag.Equals(SV.tag_Ball))
        {
            BallController ball_controller = other.gameObject.GetComponent <BallController>();
            float          dis             = fan_ground.GetDistanceToPoint(other.transform.position);
            force_Vector = force_Direction * (power / dis);
//            Debug.Log("force_Vector : " + force_Vector );
            ball_controller.AddForce(force_Vector);
        }
    }
Exemplo n.º 2
0
    //Work when touch up
    void UpTouch()
    {
        if (speed < 10)
        {
            BallController.SetPosition(ballSpawnArea.transform.position);
        }
        else if (speed > 30)
        {
            speed = 30;
            BallController.SetActiveCollider(true);
            BallController.AddForce(-direction * speed);
            LevelManager.instance.CreateBall();
        }
        else
        {
            BallController.SetActiveCollider(true);
            BallController.AddForce(-direction * speed);
            LevelManager.instance.CreateBall();
        }
        PredictionManager.instance.DeletePredict();

        touchActive = false;
    }
Exemplo n.º 3
0
 public void OnPointerDown(PointerEventData eventData)
 {
     ball.AddForce();
 }