예제 #1
0
    public static void Batch(OTSprite sprite, OTSpriteBatch batch)
    {
        if (batch!=null)
        {
            OTBatching b = sprite.GetComponent<OTBatching>();
            if (b==null)
                b = sprite.gameObject.AddComponent<OTBatching>();

            b.batch = batch;
            b.Batch();
        }
    }
    // Because we are creating sprites from scratch, it is best to start creating our sprites
    // after all containers are initialized and ready.
    void DoStart()
    {
        // Indicate that we are creating sprites from scratch
        OT.RuntimeCreationMode();
        // Create tile sprites
        CreateTiles();
        // Create asteroid sprites
        CreateAsteroids();
        // Create star sprites
        Createstars();
        // Put nice shadows under the text
        ShadowText();
        // Store the reference to the SpriteBatch object
        batch = GameObject.Find("-Batch").GetComponent<OTSpriteBatch>();

        if (batch==null)
            print("batch null");

        // Store the reference to the text container
        texts = GameObject.Find("-Text");
        // Store the reference of the transparent text panel
        textPlane = GameObject.Find("Text-Plane");
    }