Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        string     objectName;
        GameObject objectImage1;
        GameObject objectImage2;
        int        depth;
        float      speed;

        objectName   = "top";
        objectImage1 = GameScreen1;
        objectImage2 = GameScreen1A;
        Sprite[0]    = GameScreen1;
        Sprite[1]    = GameScreen1;

        Sprite[0].transform.position    = new Vector3(1f, 1f, 1f);
        objectImage1.transform.position = new Vector3(10f, 10f, 10f);

        Debug.Log(Sprite[0].transform.position);
        Debug.Log(Sprite[1].transform.position);
        Debug.Log(objectImage1.transform.position);


        depth = -1;
        speed = -0.05f;

        ScrollObject.SetScrollProperty(objectName, objectImage1, objectImage2, depth, speed);

        objectName   = "middle";
        objectImage1 = GameScreen2;
        objectImage2 = GameScreen2A;
        depth        = -2;
        speed        = -0.035f;

        ScrollObject.SetScrollProperty(objectName, objectImage1, objectImage2, depth, speed);

        objectName   = "bottom";
        objectImage1 = GameScreen3;
        objectImage2 = GameScreen3A;
        depth        = -3;
        speed        = -0.025f;

        ScrollObject.SetScrollProperty(objectName, objectImage1, objectImage2, depth, speed);



        ScrollObject.StartScroll();
    }
Exemplo n.º 2
0
    void Start()
    {
        objectImage1 = Resources.Load <Sprite>("background_back_fab");
        objectImage2 = Resources.Load <Sprite>("background_back_fab");
        int    depth;
        float  speed;
        string objectName;

        objectName = "top";

        depth = -1;
        speed = -0.05f;

        ScrollObject.SetScrollProperty(objectName, objectImage1, objectImage2, depth, speed);

        ScrollObject.StartScroll();
    }