private void Register()
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            lc.LoadStringResources("RTTerrain.StringResources");

            IWindowManager wm = IOC.Resolve <IWindowManager>();

            if (m_terrainView != null)
            {
                RegisterWindow(wm, "TerrainEditor", lc.GetString("ID_RTTerrain_WM_Header_TerrainEditor", "Terrain Editor"),
                               Resources.Load <Sprite>("icons8-earth-element-24"), m_terrainView, false);

                IRTEAppearance appearance = IOC.Resolve <IRTEAppearance>();
                appearance.ApplyColors(m_terrainView);
            }

            if (m_terrainComponentEditor != null)
            {
                IEditorsMap editorsMap = IOC.Resolve <IEditorsMap>();
                editorsMap.AddMapping(typeof(Terrain), m_terrainComponentEditor.gameObject, true, false);

                IRTEAppearance appearance = IOC.Resolve <IRTEAppearance>();
                appearance.ApplyColors(m_terrainComponentEditor.gameObject);
            }
        }
Beispiel #2
0
        private void LoadAssembly(byte[] binData)
        {
            Dictionary <string, List <UnityObject> > typeToDestroyedObjects = UnloadTypes(true);

            Dictionary <string, Guid> typeNameToGuidNew = new Dictionary <string, Guid>();

            m_runtimeAssembly = Assembly.Load(binData);
            Type[] loadedTypes = m_runtimeAssembly.GetTypes().Where(t => typeof(MonoBehaviour).IsAssignableFrom(typeof(MonoBehaviour))).ToArray();
            foreach (Type type in loadedTypes)
            {
                Guid   guid;
                string typeName = type.FullName;
                if (!m_typeNameToGuid.TryGetValue(typeName, out guid))
                {
                    guid = Guid.NewGuid();
                    m_typeNameToGuid.Add(typeName, guid);
                }

                m_editorsMap.AddMapping(type, typeof(RuntimeScriptEditor), true, false);
                m_typeMap.RegisterRuntimeSerializableType(type, guid);
                typeNameToGuidNew.Add(typeName, guid);
            }

            m_typeNameToGuid = typeNameToGuidNew;
            EraseDestroyedObjects(typeToDestroyedObjects);
        }
Beispiel #3
0
        private void TryToAddEditorMapping(Type type)
        {
            if (m_editorsMap.HasMapping(type))
            {
                return;
            }

            m_editorsMap.AddMapping(type, typeof(ComponentEditor), true, false);
        }
        private void Register()
        {
            IWindowManager wm = IOC.Resolve <IWindowManager>();

            if (m_terrainView != null)
            {
                RegisterWindow(wm, "TerrainEditor", "Terrain Editor",
                               Resources.Load <Sprite>("icons8-earth-element-24"), m_terrainView, false);
            }

            if (m_terrainComponentEditor != null)
            {
                IEditorsMap editorsMap = IOC.Resolve <IEditorsMap>();
                editorsMap.AddMapping(typeof(Terrain), m_terrainComponentEditor.gameObject, true, false);
            }
        }
Beispiel #5
0
 void IEditorsMapCreator.Create(IEditorsMap map)
 {
     map.AddMapping(typeof(GameObject), 0, true, false);
     map.AddMapping(typeof(object), 1, true, true);
     map.AddMapping(typeof(UnityEngine.Object), 2, true, true);
     map.AddMapping(typeof(bool), 3, true, true);
     map.AddMapping(typeof(Enum), 4, true, true);
     map.AddMapping(typeof(List <>), 5, true, true);
     map.AddMapping(typeof(Array), 6, true, true);
     map.AddMapping(typeof(string), 7, true, true);
     map.AddMapping(typeof(int), 8, true, true);
     map.AddMapping(typeof(float), 9, true, true);
     map.AddMapping(typeof(Range), 10, true, true);
     map.AddMapping(typeof(Vector2), 11, true, true);
     map.AddMapping(typeof(Vector3), 12, true, true);
     map.AddMapping(typeof(Vector4), 13, true, true);
     map.AddMapping(typeof(Quaternion), 14, true, true);
     map.AddMapping(typeof(Color), 15, true, true);
     map.AddMapping(typeof(Bounds), 16, true, true);
     map.AddMapping(typeof(RangeInt), 17, true, true);
     map.AddMapping(typeof(RangeOptions), 18, true, true);
     map.AddMapping(typeof(HeaderText), 19, true, true);
     map.AddMapping(typeof(MethodInfo), 20, true, true);
     map.AddMapping(typeof(Component), 21, true, false);
     map.AddMapping(typeof(BoxCollider), 22, true, false);
     map.AddMapping(typeof(Camera), 21, true, false);
     map.AddMapping(typeof(CapsuleCollider), 22, true, false);
     map.AddMapping(typeof(FixedJoint), 21, true, false);
     map.AddMapping(typeof(HingeJoint), 21, true, false);
     map.AddMapping(typeof(Light), 21, true, false);
     map.AddMapping(typeof(MeshCollider), 21, true, false);
     map.AddMapping(typeof(MeshFilter), 21, true, false);
     map.AddMapping(typeof(MeshRenderer), 21, true, false);
     map.AddMapping(typeof(MonoBehaviour), 21, false, false);
     map.AddMapping(typeof(Rigidbody), 21, true, false);
     map.AddMapping(typeof(SkinnedMeshRenderer), 21, true, false);
     map.AddMapping(typeof(Skybox), 21, true, false);
     map.AddMapping(typeof(SphereCollider), 22, true, false);
     map.AddMapping(typeof(SpringJoint), 21, true, false);
     map.AddMapping(typeof(Transform), 23, true, false);
     map.AddMapping(typeof(RuntimeAnimation), 21, true, false);
     map.AddMapping(typeof(AudioSource), 21, true, false);
     map.AddMapping(typeof(AudioListener), 21, true, false);
     map.AddMapping(typeof(LayersInfo), 24, true, false);
     map.AddMapping(typeof(RangeFlags), 25, true, true);
     map.AddMapping(typeof(LayerMask), 26, true, true);
     map.AddMapping(typeof(RectTransform), 27, true, false);
     map.AddMapping(typeof(LayoutElement), 21, true, false);
     map.AddMapping(typeof(HorizontalLayoutGroup), 21, true, false);
     map.AddMapping(typeof(VerticalLayoutGroup), 21, true, false);
     map.AddMapping(typeof(GridLayoutGroup), 21, true, false);
 }
 void IEditorsMapCreator.Create(IEditorsMap map)
 {
     map.AddMapping(typeof(UnityEngine.GameObject), 0, true, false);
     map.AddMapping(typeof(LayersInfo), 1, true, false);
     map.AddMapping(typeof(System.Object), 2, true, true);
     map.AddMapping(typeof(UnityEngine.Object), 3, true, true);
     map.AddMapping(typeof(System.Boolean), 4, true, true);
     map.AddMapping(typeof(System.Enum), 5, true, true);
     map.AddMapping(typeof(System.Collections.Generic.List <>), 6, true, true);
     map.AddMapping(typeof(System.Array), 7, true, true);
     map.AddMapping(typeof(System.String), 8, true, true);
     map.AddMapping(typeof(System.Int32), 9, true, true);
     map.AddMapping(typeof(System.Single), 10, true, true);
     map.AddMapping(typeof(Range), 11, true, true);
     map.AddMapping(typeof(UnityEngine.Vector2), 12, true, true);
     map.AddMapping(typeof(UnityEngine.Vector3), 13, true, true);
     map.AddMapping(typeof(UnityEngine.Vector4), 14, true, true);
     map.AddMapping(typeof(UnityEngine.Quaternion), 15, true, true);
     map.AddMapping(typeof(UnityEngine.Color), 16, true, true);
     map.AddMapping(typeof(UnityEngine.Bounds), 17, true, true);
     map.AddMapping(typeof(RangeInt), 18, true, true);
     map.AddMapping(typeof(RangeOptions), 19, true, true);
     map.AddMapping(typeof(HeaderText), 20, true, true);
     map.AddMapping(typeof(System.Reflection.MethodInfo), 21, true, true);
     map.AddMapping(typeof(RangeFlags), 22, true, true);
     map.AddMapping(typeof(UnityEngine.LayerMask), 23, true, true);
     map.AddMapping(typeof(UnityEngine.Component), 24, true, false);
     map.AddMapping(typeof(UnityEngine.AudioListener), 24, true, false);
     map.AddMapping(typeof(UnityEngine.AudioSource), 24, true, false);
     map.AddMapping(typeof(UnityEngine.BoxCollider), 25, true, false);
     map.AddMapping(typeof(UnityEngine.Camera), 24, true, false);
     map.AddMapping(typeof(UnityEngine.CapsuleCollider), 25, true, false);
     map.AddMapping(typeof(UnityEngine.FixedJoint), 24, true, false);
     map.AddMapping(typeof(UnityEngine.UI.GridLayoutGroup), 24, true, false);
     map.AddMapping(typeof(UnityEngine.HingeJoint), 24, true, false);
     map.AddMapping(typeof(UnityEngine.UI.HorizontalLayoutGroup), 24, true, false);
     map.AddMapping(typeof(UnityEngine.UI.LayoutElement), 24, true, false);
     map.AddMapping(typeof(UnityEngine.Light), 24, true, false);
     map.AddMapping(typeof(UnityEngine.MeshCollider), 24, false, false);
     map.AddMapping(typeof(UnityEngine.MeshFilter), 24, false, false);
     map.AddMapping(typeof(UnityEngine.MeshRenderer), 24, false, false);
     map.AddMapping(typeof(UnityEngine.MonoBehaviour), 24, false, false);
     map.AddMapping(typeof(UnityEngine.RectTransform), 26, true, false);
     map.AddMapping(typeof(UnityEngine.Rigidbody), 24, true, false);
     map.AddMapping(typeof(UnityEngine.SkinnedMeshRenderer), 24, true, false);
     map.AddMapping(typeof(UnityEngine.Skybox), 24, true, false);
     map.AddMapping(typeof(UnityEngine.SphereCollider), 25, true, false);
     map.AddMapping(typeof(UnityEngine.SpringJoint), 24, true, false);
     map.AddMapping(typeof(UnityEngine.Transform), 27, true, false);
     map.AddMapping(typeof(UnityEngine.UI.VerticalLayoutGroup), 24, true, false);
     map.AddMapping(typeof(RuntimeAnimation), 24, true, false);
     map.AddMapping(typeof(BoxRegion), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.LocalViewer.BackgroundColorControl), 28, false, false);
     map.AddMapping(typeof(Hulix.Hitonavi.LocalViewer.BackgroundParameters), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.BackgroundSubtractionNode), 29, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.ClusteringNode), 29, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.Hokuyo3d), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.Livox), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.RosConnection), 28, false, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.RosConnectionParameters), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.RosRegionsManager), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.SubscribeBoundingBoxes), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.ROS.SubscribePointCloud2), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.UnityVisualization.VisualizeBoundingBoxes), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.UnityVisualization.VisualizeTrajectory), 28, true, false);
     map.AddMapping(typeof(Hulix.Hitonavi.VisualizePointCloud2), 28, true, false);
 }