Class SmartObjects | Localization | 0.5.1-preview
docs.unity.cn
    Show / Hide Table of Contents

    Class SmartObjects

    Represents a list of objects to be used as a value argument to Smart.Format. With SmartObjects

    • all objects used for Smart.Format can be collected in one place as the first argument
    • the format string can be written like each object would be the first argument of Smart.Format
    • there is no need to bother from which argument a value should come from
    Inheritance
    Object
    List<Object>
    SmartObjects
    Namespace: UnityEngine.Localization.SmartFormat
    Syntax
    public class SmartObjects : List<object>, IList<object>, ICollection<object>, IList, ICollection, IReadOnlyList<object>, IReadOnlyCollection<object>, IEnumerable<object>, IEnumerable
    Remarks

    In case more than one object has the same member (or key) name, the value of the first object in the list will prevail. Change the order of objects in the list to change the object priority.

    Constructors

    SmartObjects()

    Initializes a new instance of the SmartObjects class.

    Declaration
    public SmartObjects()

    SmartObjects(IEnumerable<Object>)

    Initializes a new instance of the SmartObjects class that contains elements copied from the specified collection.

    Declaration
    public SmartObjects(IEnumerable<object> objList)
    Parameters
    Type Name Description
    IEnumerable<Object> objList

    The collection whose elements are copied to the new list.

    Methods

    Add(Object)

    Adds an object to the end of list.

    Declaration
    public void Add(object obj)
    Parameters
    Type Name Description
    Object obj

    Any object except types of SmartSource

    AddRange(IEnumerable<Object>)

    Adds the elements of the specified collection to the end of the list.

    Declaration
    public void AddRange(IEnumerable<object> objList)
    Parameters
    Type Name Description
    IEnumerable<Object> objList

    Any list of objects except objects of type SmartSource

    Extension Methods

    EnumerableExtensions.FormatEach<T>(IEnumerable<T>, String)
    EnumerableExtensions.Random<T>(IEnumerable<T>)
    EnumerableExtensions.RandomOrDefault<T>(IEnumerable<T>)
    EnumerableExtensions.Split<TSource>(IEnumerable<TSource>, Int32)
    EnumerableExtensions.Split<TSource>(IEnumerable<TSource>, Func<TSource, Boolean>)
    EnumerableExtensions.SplitAfter<TSource>(IEnumerable<TSource>, Func<TSource, Boolean>)
    EnumerableExtensions.Split<TSource>(IEnumerable<TSource>, Func<TSource, Int32, Boolean>)
    EnumerableExtensions.SplitAfter<TSource>(IEnumerable<TSource>, Func<TSource, Int32, Boolean>)
    EnumerableExtensions.ForEach<TSource>(IEnumerable<TSource>, Action<TSource, Int32>)
    EnumerableExtensions.ForEach<TSource>(IEnumerable<TSource>, Action<TSource>)
    EnumerableExtensions.Concat<T>(IEnumerable<T>, T[])
    EnumerableExtensions.Union<T>(IEnumerable<T>, T[])
    ExceptionCollectionExtensions.TryAll<TSource, TException>(IEnumerable<TSource>, Action<TSource>)
    ExceptionCollectionExtensions.TryAll<TSource>(IEnumerable<TSource>, Action<TSource>)
    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX