// Use this for initialization void Start() { background = GameObject.FindGameObjectWithTag ("Background").GetComponent<BackgroundParallax> (); EventManager.RegisterListener ("OnLevelComplete", gameObject); animator = GetComponent<Animator> (); mashCount = 0; }
private void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); slingShotLine = GameObject.Find("SlingshotFront").GetComponent <SlingShotLine>(); sj = GetComponent <SpringJoint2D>(); sj.connectedBody = GameObject.Find("CentrePoint").GetComponent <Rigidbody2D>(); cameraMovement = GameObject.Find("Main Camera").GetComponent <CameraMovement>(); backGroundParallax = GameObject.Find("Background").GetComponent <BackgroundParallax>(); slingRb = sj.connectedBody; }
// Use this for initialization private void Start() { playerAccrocheLianeScript = GameObject.Find("Chien").GetComponent <AccrocheLiane> (); playerScript = GameObject.Find("Chien").GetComponent <PlatformerCharacter2D> (); yAxis = 0; m_LastTargetPosition = target.position + offsetY * Vector3.up; m_OffsetZ = (transform.position - target.position).z * Vector3.forward; transform.parent = null; offsetY_stored = offsetY; backgroundParallaxScript = GetComponent <BackgroundParallax> (); }
void Awake() { // Set initial conditions backgroundSpeed = 4f; backgroundDirection = 1; // Grab the parallaxing background First = transform.GetChild(0).gameObject.GetComponent <BackgroundParallax> (); Second = transform.GetChild(1).gameObject.GetComponent <BackgroundParallax> (); UpdateBackground(); }
private void Awake() { playerRb = GetComponent <Rigidbody2D>(); cameraMovement = GameObject.Find("Main Camera").GetComponent <CameraMovement>(); backGroundParallax = GameObject.Find("Background").GetComponent <BackgroundParallax>(); }