Exemple #1
0
    protected MenuCursor GetMenuCursor(int w, int h, string sprite, float px, float py, float dx, float dy, int initX, int initY, int p = 1, int frame = -1, float dtweenchange = -1, string sortLayer = "")
    {
        GameObject g = new GameObject("Menu CursorContainer " + p);
        MenuCursor c = g.AddComponent <MenuCursor>();

        c.SetPD(PD);
        c.player = p;
        c.SetController(p == 1?PD.controller:PD.controller2, PD.GetKeyBindings(p - 1));
        c.setWidthAndHeight(w, h);
        c.Setup(th);
        c.SetupMenu(sprite, px, py, dx, dy, initX, initY, frame, dtweenchange);
        if (sortLayer != "")
        {
            c.cursor.renderer.sortingLayerName = sortLayer;
        }
        return(c);
    }