Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
Traversing a game reel matrix column by column from left to right

I have a 3x5 matrix that acts as a game reel. First, I search through the game symbols that I am interested in (let's call them wild clones) and then I search through their children (to locate the game object that has the animation) and then I activate those animations.

private IEnumerator EnableWilds(float delayBetweenWildsAppear)
{            
    WildSymbol[] wilds = FindObjectsOfType<WildSymbol>();
    GameObject[] symbols = new GameObject[wilds.Length];
    for (int i = 0; i < wilds.Length; i++)
    {
        symbols[i] = wilds[i].gameObject;
    }

    for (int i = 0; i < symbols.Length; i++)
    {
        if ( symbols[i].name.Contains("(Clone)") )
        {
            int reelIndex   = symbols[i].GetComponentInParent<GameReel>().ReelIndex;
            int indexOnReel = symbols[i].GetComponent<WildSymbol>().IndexOnReel;

            // ??

            for (int j = 0; j < symbols[i].transform.childCount; j++)
            {
                if ( symbols[i].transform.GetChild(j).gameObject.name.Contains("MM_wild") )
                {
                    symbols[i].transform.GetChild(j).gameObject.SetActive(true);
                    yield return new WaitForSeconds(delayBetweenWildsAppear);
                }
            }
        }                
    }
}

I started thinking about how I can activate those wilds starting from the top left corner, and coming down the reel and moving on to the next reel and animating the wilds from top to bottom, etc...

So, I realized I need to get each symbol's reel index (i.e. column number) and index on reel (i.e. position on the reel) so I go Reel1 and then wild clone 1 and 2 and 3, and then Reel2 followed by wild clone 1 and 2 and 3, and so on...

I am trying to do this where I have put a // ?? but at this point, I am a bit lost, conceptually. I cannot figure out how to perform tghis traversal.

Could someone please help me with this?

My game reel 1

My game reel 2

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Here is how I solved it myself, and then simplified it:

private IEnumerator DisableWilds(float delayBetweenWildsDisappear)
{            
    WildSymbol[] wilds = FindObjectsOfType<WildSymbol>();

    wilds = wilds.Where( (item, index) => item.name.Contains("(Clone)")      )
                 .OrderBy( x => x.GetComponent<WildSymbol>().IndexOnReel     )
                 .OrderBy( x => x.GetComponentInParent<GameReel>().ReelIndex )
                 .ToArray();

    for (int i = 0; i < wilds.Length; i++)
    {
        for (int j = 0; j < wilds[i].transform.childCount; j++)
        {
            if (wilds[i].transform.GetChild(j).gameObject.name.Contains("MM_wild"))
            {
                wilds[i].transform.GetChild(j).gameObject.SetActive(false);

                yield return new WaitForSeconds(delayBetweenWildsDisappear);
            }
        }
    }
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda