Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     background = GameObject.FindGameObjectWithTag ("Background").GetComponent<BackgroundParallax> ();
     EventManager.RegisterListener ("OnLevelComplete", gameObject);
     animator = GetComponent<Animator> ();
     mashCount = 0;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
 // 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> ();
 }
Ejemplo n.º 4
0
    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>();
 }