private void Awake() { cMan = GetComponent<PRAC_Off_Man>(); cPick = GetComponent<PROFST_Pick>(); cPost = GetComponent<PROFST_Post>(); cLive = GetComponent<PROFST_Live>(); cPre = GetComponent<PROFST_Pre>(); }
void Start() { cPick = GetComponent <PROFST_Pick>(); cPost = GetComponent <PROFST_Post>(); cLive = GetComponent <PROFST_Live>(); cPre = GetComponent <PROFST_Pre>(); cAud = GetComponentInChildren <AD_Prac>(); cPick.FEnter(); }
// Basically we're just testing for if they are hitting the offensive plays. public virtual void FRunUpdate() { if (Input.GetMouseButtonDown(0)) { // first, we raycast to make sure we're over the field. Because we can't spawn a player randomly off the field. RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, Vector2.zero); if (hit.collider != null) { if (hit.collider.GetComponent <PRAC_PlayArt>() != null) { string sName = hit.collider.GetComponent <PRAC_PlayArt>().mName; Debug.Log("Picked: " + sName); PROFST_Pick pPicker = FindObjectOfType <PROFST_Pick>(); pPicker.FOffPlayPicked(sName); } } else { Debug.Log("Hit nothing"); } } }