docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GameObjectOneWayCache

    Facilitates object pooling for a pre-specified collection of prefabs with the caveat that objects can be fetched from the cache but not returned. Every frame, the cache needs to be reset, which will return all objects to the pool

    Inheritance
    object
    GameObjectOneWayCache
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.Perception.Randomization.Randomizers.Utilities
    Assembly: solution.dll
    Syntax
    public class GameObjectOneWayCache

    Constructors

    Name Description
    GameObjectOneWayCache(Transform, GameObject[])

    Creates a new GameObjectOneWayCache

    Properties

    Name Description
    NumObjectsActive

    The number of active cache objects in the scene

    Methods

    Name Description
    GetOrInstantiate(GameObject)

    Retrieves an existing instance of the given prefab from the cache if available. Otherwise, instantiate a new instance of the given prefab.

    ResetAllObjects()

    Return all active cache objects back to an inactive state

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)