private void OnEndFrameRendering(UnityEngine.Rendering.ScriptableRenderContext arg1, Camera[] arg2)
        {
            UnityEngine.Rendering.RenderPipelineManager.endFrameRendering -= OnEndFrameRendering;

            //LWRP OR HDRP;

            bool wasActive = m_graphicsLayerCamera.gameObject.activeSelf;

            m_graphicsLayerCamera.gameObject.SetActive(false);

            m_renderTextureCamera = m_graphicsLayerCamera.gameObject.AddComponent <RenderTextureCamera>();
            //m_renderTextureCamera.Fullscreen = false;

            IRTE          rte         = IOC.Resolve <IRTE>();
            RuntimeWindow sceneWindow = rte.GetWindow(RuntimeWindowType.Scene);

            m_renderTextureCamera.OutputRoot      = (RectTransform)sceneWindow.transform;
            m_renderTextureCamera.OverlayMaterial = new Material(Shader.Find("Battlehub/RTCommon/RenderTextureOverlay"));
            m_graphicsLayerCamera.clearFlags      = CameraClearFlags.SolidColor;
            m_graphicsLayerCamera.backgroundColor = new Color(0, 0, 0, 0);

            m_graphicsLayerCamera.gameObject.SetActive(wasActive);
        }
        protected virtual void Awake()
        {
            IRTE rte = IOC.Resolve <IRTE>();

            m_unlitTexShader = Shader.Find("Unlit/Texture");
            if (m_objectToTextureCamera == null)
            {
                GameObject objectToTextureGO = new GameObject("Object To Texture");
                objectToTextureGO.SetActive(false);
                objectToTextureGO.transform.SetParent(transform, false);

                Camera camera = objectToTextureGO.AddComponent <Camera>();
                camera.nearClipPlane   = 0.01f;
                camera.orthographic    = true;
                camera.clearFlags      = CameraClearFlags.SolidColor;
                camera.stereoTargetEye = StereoTargetEyeMask.None;
                camera.cullingMask     = 1 << rte.CameraLayerSettings.ResourcePreviewLayer;

                m_objectToTextureCamera = objectToTextureGO.AddComponent <ObjectToTexture>();
                m_objectToTextureCamera.objectImageLayer = rte.CameraLayerSettings.ResourcePreviewLayer;

                Light[] lights = FindObjectsOfType <Light>();
                for (int i = 0; i < lights.Length; ++i)
                {
                    lights[i].cullingMask &= ~(1 << rte.CameraLayerSettings.ResourcePreviewLayer);
                }

                GameObject lightGO = new GameObject("Directional light");
                lightGO.transform.SetParent(objectToTextureGO.transform, false);
                lightGO.layer = rte.CameraLayerSettings.ResourcePreviewLayer;
                lightGO.transform.rotation = Quaternion.Euler(30, 0, 0);

                Light light = lightGO.AddComponent <Light>();
                light.type        = LightType.Directional;
                light.cullingMask = 1 << rte.CameraLayerSettings.ResourcePreviewLayer;
            }
        }
예제 #3
0
        private void Awake()
        {
            m_editor = IOC.Resolve <IRTE>();
            if (m_editor.IsPlaying || m_editor.IsPlaymodeStateChanging)
            {
                Debug.LogError("Editor should be switched to edit mode");
                return;
            }

            List <ExposeToEditor> objects = FindAll();

            for (int i = 0; i < objects.Count; ++i)
            {
                objects[i].Init();
            }
            m_editModeCache = new HashSet <ExposeToEditor>(objects);
            m_playModeCache = null;

            OnIsOpenedChanged();
            m_editor.PlaymodeStateChanging += OnPlaymodeStateChanging;
            m_editor.IsOpenedChanged       += OnIsOpenedChanged;
            m_editor.ActiveWindowChanged   += OnActiveWindowChanged;

            ExposeToEditor._Awaked     += OnAwaked;
            ExposeToEditor._Enabled    += OnEnabled;
            ExposeToEditor._Started    += OnStarted;
            ExposeToEditor._Disabled   += OnDisabled;
            ExposeToEditor._Destroying += OnDestroying;
            ExposeToEditor._Destroyed  += OnDestroyed;
            ExposeToEditor._MarkAsDestroyedChanging += OnMarkAsDestroyedChanging;
            ExposeToEditor._MarkAsDestroyedChanged  += OnMarkAsDestroyedChanged;

            ExposeToEditor._TransformChanged += OnTransformChanged;
            ExposeToEditor._NameChanged      += OnNameChanged;
            ExposeToEditor._ParentChanged    += OnParentChanged;
            ExposeToEditor._ComponentAdded   += OnComponentAdded;
        }
예제 #4
0
        private void Awake()
        {
            m_editor = IOC.Resolve <IRTE>();

            if (Window == null)
            {
                Window = GetDefaultWindow();
                if (Window == null)
                {
                    Debug.LogError("m_window == null");
                    enabled = false;
                    return;
                }
            }

            AwakeOverride();
            m_awaked = true;

            if (IsWindowActive)
            {
                OnWindowActivated();
            }
            m_editor.ActiveWindowChanged += OnActiveWindowChanged;
        }
예제 #5
0
        private void Awake()
        {
            m_editor = IOC.Resolve <IRTE>();
            if (m_editor == null)
            {
                Debug.LogError("RTE is null");
                return;
            }

            if (m_dragDropTargetGO == null)
            {
                m_dragDropTargets = new[] { this };
            }
            else
            {
                m_dragDropTargets = m_dragDropTargetGO.GetComponents <Component>().OfType <IDragDropTarget>().ToArray();
                if (m_dragDropTargets.Length == 0)
                {
                    Debug.LogWarning("dragDropTargetGO does not contains components with IDragDropTarget interface implemented");
                    m_dragDropTargets = new[] { this };
                }
            }
            AwakeOverride();
        }
예제 #6
0
        private void Awake()
        {
            m_rte = IOC.Resolve <IRTE>();

            m_rte.IsOpenedChanged += OnEditorIsOpenedChanged;

            m_objectType = ExposeToEditorObjectType.Undefined;

            Init();

            m_hierarchyItem = gameObject.GetComponent <HierarchyItem>();
            if (m_hierarchyItem == null)
            {
                m_hierarchyItem = gameObject.AddComponent <HierarchyItem>();
            }

            if (hideFlags != HideFlags.HideAndDontSave)
            {
                if (_Awaked != null)
                {
                    _Awaked(m_rte, this);
                }
            }
        }
 private void OnDestroy()
 {
     IOC.UnregisterFallback <IRTEGraphics>(this);
 }
 private void Awake()
 {
     IOC.RegisterFallback <IRTEGraphics>(this);
 }
예제 #9
0
 public static void Init()
 {
     Debug.Log("RTE Initialized, 2_1_final");
     IOC.RegisterFallback <IRTE>(RegisterRTE);
 }
예제 #10
0
 public static void Init()
 {
     Debug.Log("RTE Initialized, 2_1_x");
     IOC.RegisterFallback <IRTE>(RegisterRTE);
     SceneManager.sceneUnloaded += OnSceneUnloaded;
 }
예제 #11
0
 protected virtual void Start()
 {
     m_editor = IOC.Resolve <IRTE>();
 }
예제 #12
0
        protected override void Init()
        {
            base.Init();

            m_vrTracker = IOC.Resolve <IVRTracker>();
        }