Beispiel #1
0
    /// <summary>
    /// Returns an immutable copy of the elements of this list as an array
    /// </summary>
    /// <returns>
    /// The values.
    /// </returns>
    public AGSSyncableString[] GetValues()
    {
#if UNITY_ANDROID
        AndroidJNI.PushLocalFrame(10);

        AndroidJavaObject[] records = javaObject.Call <AndroidJavaObject[]>("getValues");

        if (records == null || records.Length == 0)
        {
            return(null);
        }

        AGSSyncableString[] returnElements =
            new AGSSyncableString[records.Length];

        for (int i = 0; i < records.Length; ++i)
        {
            returnElements[i] = new AGSSyncableString(records[i]);
        }
        AndroidJNI.PopLocalFrame(System.IntPtr.Zero);

        return(returnElements);
#else
        return(null);
#endif
    }
    /// <summary>
    /// Returns an immutable copy of the elements of this list as an array
    /// </summary>
    /// <returns>
    /// The values.
    /// </returns>
    public AGSSyncableString[] GetValues()
    {
#if UNITY_ANDROID
        AndroidJNI.PushLocalFrame(10);

        AndroidJavaObject[] records = javaObject.Call <AndroidJavaObject[]>("getValues");

        if (records == null || records.Length == 0)
        {
            return(null);
        }

        AGSSyncableString[] returnElements =
            new AGSSyncableString[records.Length];

        for (int i = 0; i < records.Length; ++i)
        {
            returnElements[i] = new AGSSyncableString(records[i]);
        }
        AndroidJNI.PopLocalFrame(System.IntPtr.Zero);

        return(returnElements);
#elif UNITY_IOS && !UNITY_EDITOR
        // Data is pulled from the strings when they are accessed.
        // To access a string in a list, you need the list key, and the list index.
        int numberOfElements          = getListSize();
        AGSSyncableString [] elements = new AGSSyncableString[numberOfElements];
        for (int listIndex = 0; listIndex < numberOfElements; listIndex++)
        {
            elements[listIndex] = new AGSSyncableString(this, listIndex, method);
        }
        return(elements);
#else
        return(null);
#endif
    }
    /// <summary>
    /// Returns an immutable copy of the elements of this list as an array
    /// </summary>
    /// <returns>
    /// The values.
    /// </returns>
    public AGSSyncableString[] GetValues()
    {
        #if UNITY_ANDROID
        AndroidJNI.PushLocalFrame(10);

        AndroidJavaObject[] records = javaObject.Call<AndroidJavaObject[]>("getValues");

        if(records == null || records.Length == 0){
            return null;
        }

        AGSSyncableString[] returnElements =
                new AGSSyncableString[records.Length];

        for( int i = 0; i < records.Length; ++i){
            returnElements[i] = new AGSSyncableString(records[i]);
        }
        AndroidJNI.PopLocalFrame(System.IntPtr.Zero);

        return returnElements;
        #elif UNITY_IOS && !UNITY_EDITOR
        // Data is pulled from the strings when they are accessed.
        // To access a string in a list, you need the list key, and the list index.
        int numberOfElements = getListSize();
        AGSSyncableString [] elements = new AGSSyncableString[numberOfElements];
        for(int listIndex = 0; listIndex < numberOfElements; listIndex++) {
            elements[listIndex] = new AGSSyncableString(this, listIndex, method );
        }
        return elements;
        #else
        return null;
        #endif
    }