FairyGUI.StageCamera.CheckMainCamera C# (CSharp) Method

CheckMainCamera() public static method

Check if there is a stage camera in the scene. If none, create one.
public static CheckMainCamera ( ) : void
return void
        public static void CheckMainCamera()
        {
            if (GameObject.Find(Name) == null)
            {
                int layer = LayerMask.NameToLayer(LayerName);
                CreateCamera(Name, 1 << layer);
            }
        }

Usage Example

Example #1
0
        /// <summary>
        ///
        /// </summary>
        public static void Instantiate()
        {
            if (_inst == null)
            {
                _inst       = new Stage();
                GRoot._inst = new GRoot();
                _inst.AddChild(GRoot._inst.displayObject);

                StageCamera.CheckMainCamera();
            }
        }
All Usage Examples Of FairyGUI.StageCamera::CheckMainCamera