public override void Update(QB_Controller_FSM qb) { if (targetIndicator == null) { targetIndicator = qb.InstantiateTargetIndicator(CalcTarget(qb)); } targetIndicator.position = CalcTarget(qb); if (Input.GetKeyDown(KeyCode.Space)) { ball_Controller.target = targetIndicator; ball_Controller.Launch(); } }
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; }