예제 #1
0
        public override int GetRowValue(long row)
        {
            var obj = m_Table.GetObjectData(row).displayObject;

            switch (obj.dataType)
            {
            case ObjectDataType.ReferenceArray:
            {
                obj = ObjectData.FromManagedPointer(m_Table.Snapshot, obj.GetReferencePointer());
                if (obj.hostManagedObjectPtr != 0)
                {
                    goto case ObjectDataType.Array;
                }
                return(-1);
            }

            case ObjectDataType.Array:
            {
                var arrayInfo = ArrayTools.GetArrayInfo(m_Table.Snapshot, obj.managedObjectData, obj.managedTypeIndex);
                return(arrayInfo.length);
            }

            default:
                return(-1);
            }
        }
예제 #2
0
 public ArrayInfo GetArrayInfo(CachedSnapshot snapshot)
 {
     if (m_dataType != ObjectDataType.Array)
     {
         UnityEngine.Debug.LogError("Requesting an ArrayInfo on an invalid data type");
         return(null);
     }
     return(ArrayTools.GetArrayInfo(snapshot, managedObjectData, m_data.managed.iType));
 }
        public string FormatArray(ObjectData od, IDataFormatter formatter)
        {
            IObjectDataTypeFormatter td;

            if (m_TypeFormatter.TryGetValue(od.managedTypeIndex, out td))
            {
                return(td.Format(m_Snapshot, od, formatter));
            }
            var str = FormatPointer(od.hostManagedObjectPtr);

            if (od.hostManagedObjectPtr != 0)
            {
                var arrayInfo = ArrayTools.GetArrayInfo(m_Snapshot, od.managedObjectData, od.managedTypeIndex);
                str += "[" + arrayInfo.ArrayRankToString() + "]";
            }
            return(str);
        }