//trovo l'indice del content attuale rispetto al numero totale (senza fun facts)
 //funzione che non servirebbe se i fun facts fossero gestiti separatamente
 int findContentIndex(InformativeSection section, string name)
 {
     if (section != null && section.contents != null && section.contents.Length != 0)
     {
         for (int j = 0; j < section.contents.Length; j++)
         {
             if (section.contents[j].name == name)
             {
                 return(j);
             }
         }
     }
     return(0);
 }
Exemple #2
0
 void setUnlocked()
 {
     for (int i = 0; i < unlockedLevelElements.Length; i++)
     {
         if (unlockedLevelElements[i] != null && GeneralFinder.informativeManager.getActualCollectiblesSection(unlockedLevelElements[i].levelNumber) != null)
         {
             unlockedLevelElements[i].unlockedLevelInfo.levelNumber = unlockedLevelElements[i].levelNumber;
             InformativeSection contentSection = GeneralFinder.informativeManager.getActualCollectiblesSection(unlockedLevelElements[i].levelNumber);
             if (contentSection != null && !contentSection.lockedSection)
             {
                 unlockedLevelElements[i].unlockedLevelInfo.isUnlocked = true;
             }
         }
     }
 }
 void handleLateralUI()
 {
     if (changedColliding)
     {
         //se non sto collidendo con nessuna porta, nascondo le sezioni laterali
         if (actualColliding == -1)
         {
             GeneralFinder.playingUILateral.showIcons(PlayingUILateral.UIPosition.Left, false);
             GeneralFinder.playingUILateral.showIcons(PlayingUILateral.UIPosition.Right, false);
         }
         else
         {
             InformativeSection objectSection   = GeneralFinder.informativeManager.getActualCollectiblesSection(actualColliding);
             InformativeSection fragmentSection = GeneralFinder.informativeManager.getActualFragmentSection(actualColliding);
             //riempio l'insieme di sprites che dovranno riempire la sezione destra
             if (objectSection != null)
             {
                 rightSprites = new Sprite[objectSection.contents.Length];
                 for (int i = 0; i < objectSection.contents.Length; i++)
                 {
                     if (objectSection.contents[i] != null)
                     {
                         if (objectSection.contents[i].lockedContent)
                         {
                             rightSprites[i] = objectSection.contents[i].iconLock;
                         }
                         else
                         {
                             rightSprites[i] = objectSection.contents[i].iconUnlock;
                         }
                     }
                 }
             }
             //riempio l'insieme di sprites che dovranno riempire la sezione sinistra
             if (fragmentSection != null)
             {
                 leftSprites = new Sprite[fragmentSection.contents.Length];
                 for (int i = 0; i < fragmentSection.contents.Length; i++)
                 {
                     if (fragmentSection.contents[i] != null)
                     {
                         if (fragmentSection.contents[i].lockedContent)
                         {
                             leftSprites[i] = fragmentSection.contents[i].iconLock;
                         }
                         else
                         {
                             leftSprites[i] = fragmentSection.contents[i].iconUnlock;
                         }
                     }
                 }
             }
             //mostro
             if (rightSprites != null && rightSprites.Length != 0)
             {
                 GeneralFinder.playingUILateral.setSprites(rightSprites, PlayingUILateral.UIPosition.Right);
                 GeneralFinder.playingUILateral.updateSpritesOnScreen(PlayingUILateral.UIPosition.Right);
                 GeneralFinder.playingUILateral.showIcons(PlayingUILateral.UIPosition.Right);
             }
             if (leftSprites != null && leftSprites.Length != 0)
             {
                 GeneralFinder.playingUILateral.setSprites(leftSprites, PlayingUILateral.UIPosition.Left);
                 GeneralFinder.playingUILateral.updateSpritesOnScreen(PlayingUILateral.UIPosition.Left);
                 GeneralFinder.playingUILateral.showIcons(PlayingUILateral.UIPosition.Left);
             }
         }
     }
 }
 void setSections()
 {
     actualContentSection  = GeneralFinder.informativeManager.getActualCollectiblesSection();
     actualFactSection     = GeneralFinder.informativeManager.getActualFunFactsSection();
     actualFragmentSection = GeneralFinder.informativeManager.getActualFragmentSection();
 }