示例#1
0
        void Start()
        {
            localizeManager = LocalizeManager.instance;

            backgroundRectTransform = chatBox.transform.GetChild(0).GetComponent <RectTransform>();
            nextButtonRectTransform = nextButton.transform.GetComponent <RectTransform>();

            typingDelay = new WaitForSeconds(typingCycle);
            blinkTime   = new WaitForSeconds(blinkCycle);

            SetLetterSizeDict();

            string[] files = Directory.GetFiles(Path.Combine(Application.dataPath, "Resources"), "*.*");
            foreach (string sourceFile in files)
            {
                string fileName = Path.GetFileName(sourceFile);
                if (fileName.Substring(fileName.Length - 4) == ".csv")
                {
                    string dialogueName = fileName.Substring(0, fileName.Length - 4);
                    Dictionary <Language, List <string> > localDictionary = new Dictionary <Language, List <string> >();
                    for (int i = 0; i < System.Enum.GetValues(typeof(Language)).Length; i++)
                    {
                        localDictionary.Add((Language)i, GetDialogue(dialogueName, i));
                    }
                    dialogueDictionary.Add(dialogueName.GetHashCode(), localDictionary);
                }
            }

            EventManager.instance.AddListener(EventType.LanguageChanged, OnLanguageChange);
        }
示例#2
0
        protected override void Awake()
        {
            base.Awake();
            localizeManager = LocalizeManager.instance;
            settingMenuSlot.SetActive(false);
            selectedSettingMenuSlot.SetActive(false);
            selectedContentSlot.SetActive(false);
            keyChangeMenu = keyChangeMenuObject.GetComponent <KeyChangeMenu>();

            selectedSettingMenuSlots = new GameObject[selectedSettingMenuSlot.transform.childCount];
            selectedContentSlots     = new GameObject[selectedContentSlot.transform.childCount];
            settingMenuSlots         = new GameObject[settingMenuSlot.transform.childCount];
            slotImage       = new Image[selectedSettingMenuSlot.transform.childCount];
            descriptionText = new Text[settingMenuSlot.transform.childCount];

            for (int i = 0; i < selectedSettingMenuSlot.transform.childCount; i++)
            {
                selectedSettingMenuSlots[i] = selectedSettingMenuSlot.transform.GetChild(i).gameObject;
                slotImage[i] = selectedSettingMenuSlots[i].GetComponent <Image>();
            }

            for (int i = 0; i < settingMenuSlot.transform.childCount; i++)
            {
                settingMenuSlots[i] = settingMenuSlot.transform.GetChild(i).gameObject;
                descriptionText[i]  = settingMenuSlots[i].transform.GetChild(0).GetComponent <Text>();
            }

            for (int i = 0; i < selectedContentSlot.transform.childCount; i++)
            {
                selectedContentSlots[i] = selectedContentSlot.transform.GetChild(i).gameObject;
            }

            settingsText = localizeManager.descriptionsDict
                           ["SettingsDesc".GetHashCode()][localizeManager.CurrentLanguage];

            for (int i = 0; i < settingMenuSlot.transform.childCount; i++)
            {
                descriptionText[i].text = localizeManager.descriptionsDict
                                          [descriptionText[i].name.GetHashCode()][localizeManager.CurrentLanguage];
            }

            arrowContent = new ArrowMenuContent
            {
                localLanguageText = selectedContentSlots[7].transform.GetChild(0).GetComponent <Text>(),
                leftArrow         = selectedContentSlots[7].transform.GetChild(1).GetComponent <Image>(),
                rightArrow        = selectedContentSlots[7].transform.GetChild(2).GetComponent <Image>(),
                leftArrowRect     = selectedContentSlots[7].transform.GetChild(1).GetComponent <RectTransform>(),
                rightArrowRect    = selectedContentSlots[7].transform.GetChild(2).GetComponent <RectTransform>()
            };
            arrowContent.localLanguageText.text = localizeManager.descriptionsDict
                                                  [arrowContent.localLanguageText.name.GetHashCode()][localizeManager.CurrentLanguage];

            blinkArrowCycle = 0.1f;
            blinkTime       = new WaitForSeconds(blinkArrowCycle);

            EventManager.instance.AddListener(EventType.LanguageChanged, OnLanguageChanged);
        }
示例#3
0
        void Start()
        {
            localizeManager = LocalizeManager.instance;

            confirmKeyText      = keyDescriptionBar.transform.GetChild(0).GetComponent <Text>();
            cancleKeyText       = keyDescriptionBar.transform.GetChild(1).GetComponent <Text>();
            confirmKeyText.text = string.Format("{0} : A", localizeManager.descriptionsDict
                                                ["ConfirmKeyDesc".GetHashCode()][localizeManager.CurrentLanguage]);
            cancleKeyText.text = string.Format("{0} : S", localizeManager.descriptionsDict
                                               ["CancleKeyDesc".GetHashCode()][localizeManager.CurrentLanguage]);

            EventManager.instance.AddListener(EventType.LanguageChanged, OnLanguageChanged);
        }
示例#4
0
        protected override void Awake()
        {
            base.Awake();

            mainMenuSlots = new GameObject[selectedMainMenuSlot.transform.childCount];
            slotImage     = new Image[selectedMainMenuSlot.transform.childCount];
            for (int i = 0; i < selectedMainMenuSlot.transform.childCount; i++)
            {
                mainMenuSlots[i] = selectedMainMenuSlot.transform.GetChild(i).gameObject;
                slotImage[i]     = mainMenuSlots[i].GetComponent <Image>();
            }

            inventoryMenu = inventoryMenuObject.GetComponent <InventoryMenu>();
            keyItemMenu   = keyItemMenuObject.GetComponent <KeyItemMenu>();
            mappingMenu   = mappingMenuObject.GetComponent <MappingMenu>();
            settingMenu   = settingMenuObject.GetComponent <SettingMenu>();
            logOutMenu    = logOutMenuObject.GetComponent <LogOutMenu>();

            selectedMenuList.Add(inventoryMenu);
            selectedMenuList.Add(keyItemMenu);
            selectedMenuList.Add(mappingMenu);
            selectedMenuList.Add(settingMenu);
            selectedMenuList.Add(logOutMenu);

            localizeManager = LocalizeManager.instance;

            inventoryText = localizeManager.descriptionsDict
                            ["InventoryDesc".GetHashCode()][localizeManager.CurrentLanguage];
            keyItemText = localizeManager.descriptionsDict
                          ["KeyItemDesc".GetHashCode()][localizeManager.CurrentLanguage];
            mapText = localizeManager.descriptionsDict
                      ["MapDesc".GetHashCode()][localizeManager.CurrentLanguage];
            settingsText = localizeManager.descriptionsDict
                           ["SettingsDesc".GetHashCode()][localizeManager.CurrentLanguage];
            returnToTitleScreenText = localizeManager.descriptionsDict
                                      ["ReturnToTitleScreenDesc".GetHashCode()][localizeManager.CurrentLanguage];

            EventManager.instance.AddListener(EventType.LanguageChanged, OnLanguageChanged);
        }
示例#5
0
        protected override void Awake()
        {
            base.Awake();
            staticContentSlot.SetActive(false);

            dynamicContentSlots = new GameObject[dynamicContentSlot.transform.childCount];
            staticContentSlots  = new GameObject[staticContentSlot.transform.childCount];
            selectedKeyCodeText = new Text[dynamicContentSlot.transform.childCount];
            descriptionText     = new Text[staticContentSlot.transform.childCount];
            slotImage           = new Image[dynamicContentSlot.transform.childCount];

            for (int i = 0; i < dynamicContentSlot.transform.childCount; i++)
            {
                dynamicContentSlots[i] = dynamicContentSlot.transform.GetChild(i).gameObject;
                slotImage[i]           = dynamicContentSlots[i].GetComponent <Image>();
            }

            scrollBarMoveAmount = 1.0f / (dynamicContentSlot.transform.childCount - maxVisialbeSlotCount);

            keyCodes = (KeyCode[])Enum.GetValues(typeof(KeyCode));

            localizeManager = LocalizeManager.instance;

            for (int i = 0; i < staticContentSlot.transform.childCount; i++)
            {
                staticContentSlots[i]   = staticContentSlot.transform.GetChild(i).gameObject;
                descriptionText[i]      = staticContentSlots[i].transform.GetChild(0).GetComponent <Text>();
                descriptionText[i].text = localizeManager.descriptionsDict
                                          [descriptionText[i].name.GetHashCode()][localizeManager.CurrentLanguage];
            }
            menuInfoText      = menuInfo.GetComponent <Text>();
            menuInfoText.text = localizeManager.descriptionsDict
                                ["CustomizeKeysDesc".GetHashCode()][localizeManager.CurrentLanguage];

            pressAnyKeyText = localizeManager.descriptionsDict
                              ["PressAnyKeyDesc".GetHashCode()][localizeManager.CurrentLanguage];

            EventManager.instance.AddListener(EventType.LanguageChanged, OnLanguageChanged);
        }