void Start() { anim = GetComponent <Animator>(); boneCollider = bone.GetComponent <BoxCollider2D> (); boneScript = bone.GetComponent <BoneThrowing> (); dogCollider = GetComponent <BoxCollider2D> (); dataPath = Application.persistentDataPath + "/playerInfo.dat"; LoadBestScore(); reStart(); leftBound = background.GetComponent <SpriteRenderer>().bounds.center.x - background.GetComponent <SpriteRenderer>().bounds.size.x / 2.0f + DogBodyLength; rightBound = background.GetComponent <SpriteRenderer>().bounds.center.x + background.GetComponent <SpriteRenderer>().bounds.size.x / 2.0f - DogBodyLength; }
void Start() { anim = GetComponent<Animator>(); boneCollider = bone.GetComponent<BoxCollider2D> (); boneScript = bone.GetComponent<BoneThrowing> (); dogCollider = GetComponent<BoxCollider2D> (); dataPath = Application.persistentDataPath + "/playerInfo.dat"; LoadBestScore(); reStart (); leftBound = background.GetComponent<SpriteRenderer>().bounds.center.x - background.GetComponent<SpriteRenderer>().bounds.size.x / 2.0f + DogBodyLength; rightBound = background.GetComponent<SpriteRenderer>().bounds.center.x + background.GetComponent<SpriteRenderer>().bounds.size.x / 2.0f - DogBodyLength; }