Beispiel #1
0
    void Start()
    {
        small_star_currentCount = 0;         // Just in case FixedUpdate doesn't get prime value

        bottomEdgeY = -6f;
        topEdgeY    = 5f;
        leftEdgeX   = -6.00f;
        rightEdgeX  = 6.00f;

        //Finding and setting ship variables. Getting score value from ship script and setting it to local
        //backround variable SCORE.
        ship       = GameObject.Find("ship");
        shipScript = ship.GetComponent <shipBehaviour> ();
        SCORE      = shipScript.SCORE;
    }
    // Use this for initialization
    void Start()
    {
        speed = 10;
        body  = GetComponent <Rigidbody2D> ();

        //Rotate sprite around Z axis ( roll ), so the bolt point upward!
        transform.Rotate(0, 0, 90f);

        //Ship control
        ship       = GameObject.Find("ship");
        shipScript = ship.GetComponent <shipBehaviour>();

        //Background control
        bg       = GameObject.Find("Background");
        bgScript = bg.GetComponent <backgroundBehaviour> ();
    }