void Start() { ThisSR = GetComponent <SpriteRenderer> (); thisAnim = GetComponent <Animator> (); countingScript = GameObject.Find("GameRunner").GetComponent <SpawnSwimmers>(); scoreScript = GameObject.Find("GameRunner").GetComponent <KeepingScore>(); }
// Use this for initialization void Start() { thisRenderer = GetComponentInChildren <SpriteRenderer> (); canAnim = GetComponentInChildren <Animator> (); scoreScript = GameObject.Find("GameRunner").GetComponent <KeepingScore>(); countingScript = GameObject.Find("GameRunner").GetComponent <SpawnSwimmers>(); //thisRenderer.sprite = fullCan; //startX = Random.Range (0, startPoints.Length-1); landValue = Random.Range(-1.4f, 1.4f); //transform.position = startPoints[startX].transform.position; }
// Use this for initialization void Start() { timeToDrown = Time.time + drowningTimer; scoreScript = GameObject.Find("GameRunner").GetComponent <KeepingScore> (); countingScript = GameObject.Find("GameRunner").GetComponent <SpawnSwimmers>(); Vector3 temp = transform.position; if (temp.x > 5.5f) { temp.x = 5.5f; transform.position = temp; } if (temp.x < -5.5f) { temp.x = -5.5f; transform.position = temp; } }