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>(); }
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; }
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; }
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(); }
// 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); }
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>(); }
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); }
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>(); }
void Start() { ballController = GameObject.FindGameObjectWithTag ("BallController").GetComponent<Ball_Controller> (); isHoldingBall = false; }
public override void EnterState(QB_Controller_FSM qb) { targetReceiver = qb.Receiver_current.GetComponent <Receiver_Controller_FSM>(); ball_Controller = qb.GetComponent <Ball_Controller>(); }
void Start() { ballController = GameObject.FindGameObjectWithTag("BallController").GetComponent <Ball_Controller> (); isHoldingBall = false; }