private void OnEnable() { statScript = GameObject.FindGameObjectWithTag("PlaneStat").GetComponent <PlaneStatus>(); statScript.isRedPlane = true; redPlane.SetActive(true); greenPlane.SetActive(false); }
void initiate() { myRigidbody = GetComponent <Rigidbody2D>(); statScript = GameObject.FindGameObjectWithTag("PlaneStat").GetComponent <PlaneStatus>(); if (statScript.isRedPlane) { redPlane.SetActive(true); greenPlane.SetActive(false); sRend = redPlane.GetComponent <SpriteRenderer>(); } else { redPlane.SetActive(false); greenPlane.SetActive(true); sRend = greenPlane.GetComponent <SpriteRenderer>(); } anim = GetComponent <Animator>(); }
private void OnEnable() { scoreCanvas = GameObject.FindGameObjectWithTag("Score"); scoreScript = scoreCanvas.GetComponent <ScoreBoard>(); statScript = GameObject.FindGameObjectWithTag("PlaneStat").GetComponent <PlaneStatus>(); }