Exemplo n.º 1
0
    public static SliderArrow Spawn(Sprite sprite, Vector3 localPosition, Transform parent, int x, int y)
    {
        // Attempt to use a pooled block
        tmp = null;
        for (int i = 0; i < Pool.Count; i++)
        {
            if (Pool[i] != null && !Pool[i].gameObject.activeSelf)
            {
                tmp = Pool[i];
                tmp.gameObject.SetActive(true);
                tmp.InitializeFromPool(sprite, localPosition, parent, x, y);
                return(tmp);
            }
        }

        // Create a new block
        tmp = (SliderArrow)Instantiate(prefab);
        tmp.InitializeFromPool(sprite, localPosition, parent, x, y);
        Pool.Add(tmp);
        return(tmp);
    }
Exemplo n.º 2
0
    void CreateArrows()
    {
        for (int c = 0; c < Cols; c++)
        {
            ColArrows[c] = new SliderArrow[]
            {
                SliderArrow.Spawn(DownArrow, GetLocalPosition(c, -1), _t, 0, -1),
                SliderArrow.Spawn(UpArrow, GetLocalPosition(c, Rows), _t, 0, 1),
            };
        }


        for (int r = 0; r < Rows; r++)
        {
            RowArrows[r] = new SliderArrow[]
            {
                SliderArrow.Spawn(LeftArrow, GetLocalPosition(-1, r), _t, -1, 0),
                SliderArrow.Spawn(RightArrow, GetLocalPosition(Cols, r), _t, 1, 0),
            };
        }
    }
 public CytusDrawableSliderEnd(CytusSliderTick hitObject, float x, float y, TextureStore textures) : base(hitObject, x, y, textures)
 {
     // Don't show the arrow, since we're the last one
     SliderArrow.Hide();
 }
Exemplo n.º 4
0
 public static void Despawn(SliderArrow tile)
 {
     tile.gameObject.SetActive(false);
 }