docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method Initialize

    Initialize()

    Implement Initialize() to perform one-time initialization or set up of the Agent instance.

    Declaration
    public virtual void Initialize()
    Remarks

    Initialize() is called once when the agent is first enabled. If, for example, the Agent object needs references to other [GameObjects] in the scene, you can collect and store those references here.

    Note that OnEpisodeBegin() is called at the start of each of the agent's "episodes". You can use that function for items that need to be reset for each episode.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023