示例#1
0
            public Task <string> GetName()
            {
                if (!ObjName.Empty())
                {
                    return(Task.FromResult(ObjName));
                }

                string name = NamesStore.GetByIndex(Object.Name.Index);

                if (!name.Empty() && (Object.Name.Number > 0 && Object.Name.Index != Object.Name.Number))
                {
                    name += "_" + Object.Name.Number;
                }

                int pos = name.LastIndexOf('/');

                if (pos == -1)
                {
                    ObjName = name;
                    return(Task.FromResult(ObjName));
                }

                ObjName = name.Substring(pos + 1);
                return(Task.FromResult(ObjName));
            }
示例#2
0
            public async Task <List <string> > GetNames()
            {
                if (ObjEnum.Empty())
                {
                    ObjEnum = await Object.Cast <UEnum>();
                }

                // Get Names
                IntPtr dataAddress = ObjEnum.Names.Data;

                if (ObjEnum.Names.Count > 300)
                {
                    throw new IndexOutOfRangeException("Enum have more than 300 value !!, Maybe EngineStructs Problem.!");
                }

                var cls    = Utils.MemObj.ReadClassArray <FUEnumItem>(dataAddress, ObjEnum.Names.Count);
                var buffer = cls
                             .Where(e => e.Key.Index < NamesStore.GNames.Names.Count || e.Key.Index != 0)
                             .Select(e => NamesStore.GetByIndex(e.Key.Index))
                             .ToList();

                return(buffer);
            }