#pragma warning restore CS0649
    // Start is called before the first frame update
    void Start()
    {
        sceneDataList = SceneListLoader.LoadSceneList();
        GameObject temp = map.interactables[0];

        Component[] c = temp.GetComponentsInChildren(typeof(Image));
        if (c != null && c.Length != 0)
        {
            for (int i = 0; i < c.Length; i++)
            {
                if (c[i].gameObject != temp)
                {
                    ((Image)c[i]).enabled = false;
                }
            }
        }
        map.interactables.RemoveAt(0);
        for (int i = 0; i < sceneDataList.list.Count; i++)
        {
            map.interactables.Add(CreateButton(sceneDataList.list[i], new Vector3(0, -10 * (i + 1), 0)).gameObject);
        }
        map.interactables.Add(temp);

        InteractableList interactableList = ListSingleton.instance;

        interactableList.UpdateMap(map);
        // interactableList.ClearList();
        // interactableList.FindInteractables();
        // interactableList.Next();
        EventSystem.current.SetSelectedGameObject(interactableList.focusedGo);
        DescriptionPlayer dp = interactableList.focusedGo.GetComponent(typeof(DescriptionPlayer)) as DescriptionPlayer;

        dp.OnDescriptorPress(null);
        viewControl.CheckGraphics();
    }
 // Start is called before the first frame update
 void Start()
 {
     toggle.isOn = PlayerPrefs.GetInt("showInterface", 1) == 1;
     if (toggle.isOn)
     {
         descriptionPlayer.audioClip = desativar;
     }
     else
     {
         descriptionPlayer.audioClip = ativar;
     }
     descriptionPlayer.OnDescriptorPress(null);
 }
 // Ao iniciar o module é realizada uma busca de objetos interagíveis.
 // TODO Verificar a possibilidade de popular a lista de outros meios
 protected override void Start()
 {
     base.Start();
     interactableList = ListSingleton.instance;
     // interactableList.ClearList();
     //interactableList.FindInteractables();
     if (!interactableList.isEmpty)
     {
         eventSystem.SetSelectedGameObject(interactableList.focusedGo);
         DescriptionPlayer dp = interactableList.focusedGo.GetComponent(typeof(DescriptionPlayer)) as DescriptionPlayer;
         dp.OnDescriptorPress(null);
     }
 }
Exemple #4
0
    #pragma warning restore CS0649
    // Realiza a mudança do canvas, desativando o atual e desativando o novo.
    public void changeCanvas(GameObject newCanvas)
    {
        // Troca o canvas ativo
        currentCanvas.SetActive(false);
        newCanvas.SetActive(true);

        // Obtêm o novo objeto que tem o foco atualmente.
        GameObject g = ListSingleton.instance.focusedGo;

        // Define ele como selecionado (Preciso fazer isso aqui ou ele não fica "aceso" na tela.)
        Selectable s = g.GetComponent(typeof(Selectable)) as Selectable;

        s.Select();

        // Toca a descrição o primeiro botão selecionado na nova tela.
        DescriptionPlayer dp = ListSingleton.instance.focusedGo.GetComponent(typeof(DescriptionPlayer)) as DescriptionPlayer;

        dp.OnDescriptorPress(null);
    }