ME3Explorer.UnrealHelper.UPropertyReader.FindProperty C# (CSharp) Method

FindProperty() public method

public FindProperty ( string s, List p ) : int
s string
p List
return int
        public int FindProperty(string s,List<Property> p)
        {
            int ret = -1;
            for (int i = 0; i < p.Count; i++)
                if (p[i].name == s)
                    ret = i;
            return ret;
        }

Usage Example

        public void CloneObject(int index)
        {
            int    n = Entries[index];
            Matrix m = Matrices[index];

            Entries.Add(n);
            Matrices.Add(m);
            MemoryStream mem    = new MemoryStream();
            int          ent    = UPR.FindProperty("StaticMeshComponents", props) + 1;
            int          off    = props[ent].offset + 8;
            int          offend = props[ent].offset + props[ent].raw.Length;

            mem.Write(memory, 0, off);
            mem.Write(BitConverter.GetBytes(Entries.Count * 4 + 4), 0, 4);
            mem.Write(BitConverter.GetBytes((Int32)0), 0, 4);
            mem.Write(BitConverter.GetBytes(Entries.Count), 0, 4);
            for (int i = 0; i < Entries.Count; i++)
            {
                mem.Write(BitConverter.GetBytes(Entries[i] + 1), 0, 4);
            }
            if (ent + 1 < props.Count)
            {
                int offnextend = props[props.Count - 1].offset + props[props.Count - 1].raw.Length;
                mem.Write(memory, offend, offnextend - offend);
            }
            for (int i = 0; i < Matrices.Count; i++)
            {
                mem = StreamAppend(mem, MatrixToStream(Matrices[i]));
            }
            memory  = mem.ToArray();
            memsize = memory.Length;
            CHANGED = true;
        }
All Usage Examples Of ME3Explorer.UnrealHelper.UPropertyReader::FindProperty