Example #1
0
        /// <summary>
        /// Creates or resets a preview camera manager object as a child of the given transform.
        /// </summary>
        /// <param name="parentTransform"></param> The parent transform.
        /// <returns></returns> The preview camera manager object.
        public static PreviewCameraManager CreateOrResetPreviewCameraManager(Transform parentTransform = null)
        {
            PreviewCameraManager existingManager = GeneralToolkit.GetComponentInChildrenOnly <PreviewCameraManager>(parentTransform);

            if (existingManager == null)
            {
                existingManager = GeneralToolkit.CreateChildComponent <PreviewCameraManager>(parentTransform);
            }
            return(existingManager);
        }