void Awake()
    {
        myRb = GetComponent <Rigidbody2D>();

        ballGo          = GameObject.Find("Ball");
        ball_controller = GameObject.Find("QB").GetComponent <Ball_Controller>();
        qB_Controller   = GameObject.Find("QB").GetComponent <QB_Controller_FSM>();
    }
Esempio n. 2
0
 void Start()
 {
     ballController = GameObject.FindGameObjectWithTag ("BallController").GetComponent<Ball_Controller> ();
     playerHoldingBall = this.gameObject.GetComponent<Player_HoldingBall> ();
     playerController = this.gameObject.GetComponent<Player_Movement> ();
     throwSpeed = 10.0f;
     throwPower = 0.25f;
     playerTransform = this.transform;
 }
Esempio n. 3
0
 void Start()
 {
     ballController    = GameObject.FindGameObjectWithTag("BallController").GetComponent <Ball_Controller> ();
     playerHoldingBall = this.gameObject.GetComponent <Player_HoldingBall> ();
     playerController  = this.gameObject.GetComponent <Player_Movement> ();
     throwSpeed        = 10.0f;
     throwPower        = 0.25f;
     playerTransform   = this.transform;
 }
Esempio n. 4
0
    void Awake()
    {
        myRb = GetComponent <Rigidbody2D>();


        ball_controller = GameObject.Find("QB").GetComponent <Ball_Controller>();
        qB_Controller   = GameObject.Find("QB").GetComponent <QB_Controller_FSM>();

        ball_controller.ballAwarePlayers.Add(this);
    }
        void Awake()
        {
            myRb = GetComponent <Rigidbody2D>();


            ball_controller = GameObject.Find("QB").GetComponent <Ball_Controller>();
            qB_Controller   = GameObject.Find("QB").GetComponent <QB_Controller_FSM>();

            ball_controller.ballAwarePlayers.Add(this);

            //get random skills for this player
            //SetRandomSkill();
            SetMaxSkill();
        }
Esempio n. 6
0
    // Start is called before the first frame update
    void Start()
    {
        leftScore  = leftScoreText.GetComponent <TextMeshProUGUI>();
        rightScore = rightScoreText.GetComponent <TextMeshProUGUI>();

        leftScore.text  = leftScoreInt.ToString();
        rightScore.text = rightScoreInt.ToString();

        ballController  = FindObjectOfType <Ball_Controller>();
        sceneController = FindObjectOfType <SceneController>();

        winCanvas.SetActive(false);
        optionsCanvas.SetActive(false);
    }
Esempio n. 7
0
    void Awake()
    {
        GameObject receiversObj = GameObject.Find("Receivers");

        Receivers = new GameObject[receiversObj.transform.childCount];

        int childIndex = 0;

        foreach (Transform receiver in receiversObj.transform)
        {
            Receivers[childIndex++] = receiver.gameObject;
        }

        ball_Controller = GetComponent <Ball_Controller>();
    }
Esempio n. 8
0
        void Awake()
        {
            myRb = GetComponent <Rigidbody2D>();


            ball_controller = GameObject.Find("QB").GetComponent <Ball_Controller>();
            qB_Controller   = GameObject.Find("QB").GetComponent <QB_Controller_FSM>();

            ball_controller.ballAwarePlayers.Add(this);


            //get random skills for this player
            speed         = Random.Range(2.5f, 4.5f);
            reactionDelay = Random.Range(0.2f, 1.5f);
        }
Esempio n. 9
0
    public override void EnterState(QB_Controller_FSM qb)
    {
        targetReceiver  = qb.Receiver_current.GetComponent <Receiver_Controller_FSM>();
        ball_Controller = qb.GetComponent <Ball_Controller>();

        //this is so that we throw imedialty when we enter the state
        if (targetIndicator == null)
        {
            targetIndicator = qb.InstantiateTargetIndicator(CalcTarget(qb));
        }
        else
        {
            targetIndicator.gameObject.SetActive(true);
            targetIndicator.position = CalcTarget(qb);
        }

        ball_Controller.target = targetIndicator;
        ball_Controller.Launch();
        GameManager.Instance.ballLaunched = true;
    }
 // Use this for initialization
 void Start()
 {
     BS_script = Ball.GetComponent <Ball_Controller>();
 }
Esempio n. 11
0
 void Start()
 {
     ballController = GameObject.FindGameObjectWithTag ("BallController").GetComponent<Ball_Controller> ();
     isHoldingBall = false;
 }
Esempio n. 12
0
 public override void EnterState(QB_Controller_FSM qb)
 {
     targetReceiver  = qb.Receiver_current.GetComponent <Receiver_Controller_FSM>();
     ball_Controller = qb.GetComponent <Ball_Controller>();
 }
Esempio n. 13
0
 void Start()
 {
     ballController = GameObject.FindGameObjectWithTag("BallController").GetComponent <Ball_Controller> ();
     isHoldingBall  = false;
 }