コード例 #1
0
        public static string GetObjectName(int objectId, Locale locale = Locale.UnitedStates)
        {
            Ensure();

            var names = _phrases.FirstOrDefault(p =>
                                                p.Attributes != null && p.Attributes["id"].Value == $"Objects_{objectId}_name");

            if (names == default)
            {
                AddPhrase($"Objects_{objectId}_name");
                return("");
            }
            ;

            Debug.Log(names.ChildNodes.Count);

            for (var i = 0; i < names.ChildNodes.Count; i++)
            {
                var child = names.ChildNodes[i];

                if (child.Attributes == default)
                {
                    continue;
                }

                Debug.Log(child.Attributes[0].Value);

                if (child.Attributes["locale"].Value == locale.Code())
                {
                    return(child.InnerText);
                }
            }

            return(default);