コード例 #1
0
ファイル: Monster.cs プロジェクト: Zanion/Ascent_of_Numrock
    public Monster( string name, int level, bool isBoss, GameObject characterObject)
        : base(name, level, level * 12)
    {
        Speed = 0;

        BasicAttack	  = new Basic();
        StrongAttack  = new Strong();
        SpecialAttack = new Special();

        BasicDefend   = new Basic();
        StrongDefend  = new Strong();
        SpecialDefend = new Special();

        CharacterObject = characterObject;

        Monster _thisMonster = this;
        IsBoss = isBoss;

        if (isBoss)
        {
            Health.SetNewMaxValue(Health.MaxValue * 3);
            AIBehavior = new BossAIBehavior(ref _thisMonster);
        }
        else
        {
            AIBehavior = new MinionAIBehavior(ref _thisMonster);
        }
    }
コード例 #2
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo isTriggerInfo = Strong.PropertyInfo((BoxCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo  = Strong.PropertyInfo((BoxCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo centerInfo    = Strong.PropertyInfo((BoxCollider x) => x.center, "center");
            MemberInfo sizeInfo      = Strong.PropertyInfo((BoxCollider x) => x.size, "size");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_BoxCollider_IsTrigger", "Is Trigger"), editor.Components, isTriggerInfo, "m_IsTrigger"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_BoxCollider_Material", "Material"), editor.Components, materialInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_BoxCollider_Center", "Center"), editor.Components, centerInfo, "m_Center"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_BoxCollider_Size", "Size"), editor.Components, sizeInfo, "m_Size"),
            });
        }
コード例 #3
0
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo connectedBodyInfo       = Strong.MemberInfo((SpringJoint x) => x.connectedBody);
            MemberInfo breakForceInfo          = Strong.MemberInfo((SpringJoint x) => x.breakForce);
            MemberInfo breakTorqueInfo         = Strong.MemberInfo((SpringJoint x) => x.breakTorque);
            MemberInfo enableCollisionInfo     = Strong.MemberInfo((SpringJoint x) => x.enableCollision);
            MemberInfo enablePreporcessingInfo = Strong.MemberInfo((SpringJoint x) => x.enablePreprocessing);

            return(new[]
            {
                new PropertyDescriptor("ConnectedBody", editor.Component, connectedBodyInfo),
                new PropertyDescriptor("Break Force", editor.Component, breakForceInfo),
                new PropertyDescriptor("Break Torque", editor.Component, breakTorqueInfo),
                new PropertyDescriptor("Enable Collision", editor.Component, enableCollisionInfo),
                new PropertyDescriptor("Enable Preprocessing", editor.Component, enablePreporcessingInfo),
            });
        }
コード例 #4
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo connectedBodyInfo       = Strong.PropertyInfo((FixedJoint x) => x.connectedBody, "connectedBody");
            MemberInfo breakForceInfo          = Strong.PropertyInfo((FixedJoint x) => x.breakForce, "breakForce");
            MemberInfo breakTorqueInfo         = Strong.PropertyInfo((FixedJoint x) => x.breakTorque, "breakTorque");
            MemberInfo enableCollisionInfo     = Strong.PropertyInfo((FixedJoint x) => x.enableCollision, "enableCollision");
            MemberInfo enablePreporcessingInfo = Strong.PropertyInfo((FixedJoint x) => x.enablePreprocessing, "enablePreprocessing");

            return(new[]
            {
                new PropertyDescriptor("ConnectedBody", editor.Component, connectedBodyInfo),
                new PropertyDescriptor("Break Force", editor.Component, breakForceInfo),
                new PropertyDescriptor("Break Torque", editor.Component, breakTorqueInfo),
                new PropertyDescriptor("Enable Collision", editor.Component, enableCollisionInfo),
                new PropertyDescriptor("Enable Preprocessing", editor.Component, enablePreporcessingInfo),
            });
        }
コード例 #5
0
        private void OnBeginRotate(BaseHandle rotationHandle)
        {
            IMeshEditor meshEditor = GetEditor();

            if (meshEditor != null)
            {
                rotationHandle.EnableUndo = false;
                m_initialRotation         = GetPivotRotation(meshEditor);
                m_pivot.rotation          = m_initialRotation;
                m_initialRight            = m_pivot.TransformDirection(Vector3.right);
                m_initialUVRotation       = UV.rotation;
                if (UVEditingMode)
                {
                    m_rte.Undo.BeginRecordValue(UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.rotation));
                }
                meshEditor.BeginRotate(m_initialRotation);
            }
        }
コード例 #6
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converterObj)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            TransformPropertyConverter converter = (TransformPropertyConverter)converterObj;

            MemberInfo position          = Strong.PropertyInfo((Transform x) => x.localPosition, "position");
            MemberInfo rotation          = Strong.PropertyInfo((Transform x) => x.localRotation, "rotation");
            MemberInfo rotationConverted = Strong.PropertyInfo((TransformPropertyConverter x) => x.localEuler, "localEuler");
            MemberInfo scale             = Strong.PropertyInfo((Transform x) => x.localScale, "localScale");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_RectTransform_Position", "Position"), editor.Component, position, position),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_RectTransform_Rotation", "Rotation"), converter, rotationConverted, rotation),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_RectTransform_Scale", "Scale"), editor.Component, scale, scale)
            });
        }
コード例 #7
0
 public bool Add(int id, object obj)
 {
     if (StrongCount > 0)
     {
         Strong.Add(id, obj);
         StrongCount--;
         return(true);
     }
     else if (WeakCount > 0)
     {
         Dictionary <int, object> DicTmp = (Dictionary <int, object>)Weak.Target;
         DicTmp.Add(id, obj);
         Weak = new WeakReference(DicTmp);
         WeakCount--;
         return(true);
     }
     return(false);
 }
コード例 #8
0
        private void Awake()
        {
            m_proBuilderTool = IOC.Resolve <IProBuilderTool>();

            NormalsScale   = PlayerPrefs.GetFloat("SmoothGroupsEditor.NormalsScale", 0.2f);
            PreviewOpacity = PlayerPrefs.GetFloat("SmoothGroupsEditor.PreviewOpacity", 0.5f);

            ILocalization lc = IOC.Resolve <ILocalization>();

            if (m_normalsScaleEditor != null)
            {
                m_normalsScaleEditor.Init(this, Strong.PropertyInfo((SmoothGroupsEditor x) => x.NormalsScale), lc.GetString("ID_RTBuilder_SmoothGroupsEditor_NormalsScale"), false);
            }
            if (m_previewOpacityEditor != null)
            {
                m_previewOpacityEditor.Init(this, Strong.PropertyInfo((SmoothGroupsEditor x) => x.PreviewOpacity), lc.GetString("ID_RTBuilder_SmoothGroupsEditor_PreviewOpacity"), false);
            }
        }
コード例 #9
0
        private void Awake()
        {
            m_editor = IOC.Resolve <IRuntimeEditor>();

            m_commandsList.ItemClick       += OnItemClick;
            m_commandsList.ItemDataBinding += OnItemDataBinding;
            m_commandsList.ItemExpanding   += OnItemExpanding;
            m_commandsList.ItemBeginDrag   += OnItemBeginDrag;
            m_commandsList.ItemDrop        += OnItemDrop;
            m_commandsList.ItemDragEnter   += OnItemDragEnter;
            m_commandsList.ItemDragExit    += OnItemDragExit;
            m_commandsList.ItemEndDrag     += OnItemEndDrag;

            m_commandsList.CanEdit        = false;
            m_commandsList.CanReorder     = false;
            m_commandsList.CanReparent    = false;
            m_commandsList.CanSelectAll   = false;
            m_commandsList.CanUnselectAll = true;
            m_commandsList.CanRemove      = false;

            m_localization    = IOC.Resolve <ILocalization>();
            m_terrainTool     = IOC.Resolve <ITerrainSelectionHandlesTool>();
            m_customSelection = IOC.Resolve <ICustomSelectionComponent>();
            m_customSelection.Selection.SelectionChanged += OnTerrainToolSelectionChanged;

            if (m_xSpacingEditor != null)
            {
                m_xSpacingEditor.Min = 5;
                m_xSpacingEditor.Max = 40;
                m_xSpacingEditor.Init(m_terrainTool, m_terrainTool, Strong.PropertyInfo((ITerrainSelectionHandlesTool x) => x.XSpacing), null, m_localization.GetString("ID_RTTerrain_SelectionHandles_XSpacing", "X Space"), null, null, () => m_terrainTool.Refresh(), false);
            }

            if (m_zSpacingEditor != null)
            {
                m_zSpacingEditor.Min = 5;
                m_zSpacingEditor.Max = 40;
                m_zSpacingEditor.Init(m_terrainTool, m_terrainTool, Strong.PropertyInfo((ITerrainSelectionHandlesTool x) => x.ZSpacing), null, m_localization.GetString("ID_RTTerrain_SelectionHandles_ZSpacing", "Z Space"), null, null, () => m_terrainTool.Refresh(), false);
            }

            if (m_zTestEditor != null)
            {
                m_zTestEditor.Init(m_terrainTool, m_terrainTool, Strong.PropertyInfo((ITerrainSelectionHandlesTool x) => x.EnableZTest), null, m_localization.GetString("ID_RTTerrain_SelectionHandles_ZTest", "Z Test"));
            }
        }
コード例 #10
0
        public bool GetAndRemove(int id, out object obj)
        {
            obj = null;
            object tmp = null;

            if (Strong.FirstOrDefault(c => c.Key == id).Value != null)
            {
                tmp = Strong[id];
            }


            if (tmp == null)
            {
                Dictionary <int, object> DicTmp = (Dictionary <int, object>)Weak.Target;
                if (DicTmp == null)
                {
                    return(false);
                }
                object tmp2 = null;
                if (DicTmp.FirstOrDefault(c => c.Key == id).Value != null)
                {
                    tmp2 = DicTmp[id];
                }

                if (tmp2 == null)
                {
                    return(false);
                }
                else
                {
                    obj = tmp2;
                    DicTmp.Remove(id);
                    WeakCount++;
                    return(true);
                }
            }
            else
            {
                Strong.Remove(id);
                obj = tmp;
                StrongCount++;
                return(true);
            }
        }
コード例 #11
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo connectedBodyInfo       = Strong.PropertyInfo((FixedJoint x) => x.connectedBody, "connectedBody");
            MemberInfo breakForceInfo          = Strong.PropertyInfo((FixedJoint x) => x.breakForce, "breakForce");
            MemberInfo breakTorqueInfo         = Strong.PropertyInfo((FixedJoint x) => x.breakTorque, "breakTorque");
            MemberInfo enableCollisionInfo     = Strong.PropertyInfo((FixedJoint x) => x.enableCollision, "enableCollision");
            MemberInfo enablePreporcessingInfo = Strong.PropertyInfo((FixedJoint x) => x.enablePreprocessing, "enablePreprocessing");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_FixedJoint_ConnectedBody", "Connected Body"), editor.Component, connectedBodyInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_FixedJoint_BreakForce", "Break Force"), editor.Component, breakForceInfo, "m_BreakForce"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_FixedJoint_BreakTorque", "Break Torque"), editor.Component, breakTorqueInfo, "m_BreakTorque"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_FixedJoint_EnableCollision", "Enable Collision"), editor.Component, enableCollisionInfo, "m_EnableCollision"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_FixedJoint_EnablePerprocessing", "Enable Preprocessing"), editor.Component, enablePreporcessingInfo, "m_EnablePreprocessing"),
            });
        }
コード例 #12
0
        private void OnEndRotate(BaseHandle rotationHandle)
        {
            IMeshEditor meshEditor = GetEditor();

            if (meshEditor != null)
            {
                rotationHandle.EnableUndo = true;

                Quaternion initialRotation = m_initialRotation;
                Quaternion endRotation     = m_pivot.rotation;
                meshEditor.EndRotate();

                Quaternion newStartRotation = GetPivotRotation(meshEditor);
                m_pivot.rotation = newStartRotation;

                if (UVEditingMode)
                {
                    m_rte.Undo.EndRecordValue(UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.rotation));
                }
                else
                {
                    m_rte.Undo.CreateRecord(record =>
                    {
                        meshEditor.BeginRotate(initialRotation);
                        meshEditor.Rotate(endRotation);
                        meshEditor.EndRotate();

                        m_pivot.transform.rotation = newStartRotation;
                        return(true);
                    },
                                            record =>
                    {
                        meshEditor.BeginRotate(endRotation);
                        meshEditor.Rotate(initialRotation);
                        meshEditor.EndRotate();

                        m_pivot.transform.rotation = initialRotation;
                        return(true);
                    });
                }
            }
        }
コード例 #13
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            PropertyEditorCallback valueChanged = () => editor.BuildEditor();

            MemberInfo convexInfo    = Strong.PropertyInfo((MeshCollider x) => x.convex, "convex");
            MemberInfo isTriggerInfo = Strong.PropertyInfo((MeshCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo  = Strong.PropertyInfo((MeshCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo meshInfo      = Strong.PropertyInfo((MeshCollider x) => x.sharedMesh, "sharedMesh");

            bool?hasMixedValues;
            bool isConvex = GetIsConvex(editor, out hasMixedValues);

            if (hasMixedValues != null)
            {
                if (isConvex && hasMixedValues == false)
                {
                    return(new[]
                    {
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Convex", "Convex"), editor.Components, convexInfo, convexInfo, valueChanged)
                        {
                            AnimationPropertyName = "m_Convex"
                        },
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_IsTrigger", "Is Trigger"), editor.Components, isTriggerInfo, "m_IsTrigger"),
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Material", "Material"), editor.Components, materialInfo, materialInfo),
                        new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Mesh", "Mesh"), editor.Components, meshInfo, meshInfo),
                    });
                }

                return(new[]
                {
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Convex", "Convex"), editor.Components, convexInfo, convexInfo, valueChanged)
                    {
                        AnimationPropertyName = "m_Convex"
                    },
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Material", "Material"), editor.Components, materialInfo, materialInfo),
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Mesh", "Mesh"), editor.Components, meshInfo, meshInfo),
                });
            }
            return(new PropertyDescriptor[0]);
        }
コード例 #14
0
        public byte[] ToByteArray()
        {
            List <byte> result = new List <byte>(25);

            result.Add(PA);
            result.Add(MA);
            result.Add(Speed);
            result.Add(Move);
            result.Add(Jump);
            result.AddRange(PermanentStatuses.ToByteArray());
            result.AddRange(StatusImmunity.ToByteArray());
            result.AddRange(StartingStatuses.ToByteArray());
            result.Add(Absorb.ToByte());
            result.Add(Cancel.ToByte());
            result.Add(Half.ToByte());
            result.Add(Weak.ToByte());
            result.Add(Strong.ToByte());

            return(result.ToArray());
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            object[] converters = (object[])converter;

            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo position          = Strong.PropertyInfo((Transform x) => x.localPosition, "localPosition");
            MemberInfo positionConverted = Strong.PropertyInfo((TransformPropertyConverter x) => x.LocalPosition, "LocalPosition");
            MemberInfo rotation          = Strong.PropertyInfo((Transform x) => x.localRotation, "localRotation");
            MemberInfo rotationConverted = Strong.PropertyInfo((TransformPropertyConverter x) => x.LocalEuler, "LocalEulerAngles");
            MemberInfo scale             = Strong.PropertyInfo((Transform x) => x.localScale, "localScale");
            MemberInfo scaleConverted    = Strong.PropertyInfo((TransformPropertyConverter x) => x.LocalScale, "LocalScale");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Transform_Position", "Position"), converters, positionConverted, position),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Transform_Rotation", "Rotation"), converters, rotationConverted, rotation),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Transform_Scale", "Scale"), converters, scaleConverted, scale)
            });
        }
コード例 #16
0
    private void Awake()
    {
        m_editor = IOC.Resolve <IRTE>();

        m_terrainTool = IOC.Resolve <ITerrainTool>();

        m_editor.Selection.SelectionChanged += OnSelectionChanged;

        m_commandsList.ItemClick       += OnItemClick;
        m_commandsList.ItemDataBinding += OnItemDataBinding;
        m_commandsList.ItemExpanding   += OnItemExpanding;
        m_commandsList.ItemBeginDrag   += OnItemBeginDrag;
        m_commandsList.ItemDrop        += OnItemDrop;
        m_commandsList.ItemDragEnter   += OnItemDragEnter;
        m_commandsList.ItemDragExit    += OnItemDragExit;
        m_commandsList.ItemEndDrag     += OnItemEndDrag;

        m_commandsList.CanEdit        = false;
        m_commandsList.CanReorder     = false;
        m_commandsList.CanReparent    = false;
        m_commandsList.CanSelectAll   = false;
        m_commandsList.CanUnselectAll = true;
        m_commandsList.CanRemove      = false;

        if (m_spacingEditor != null)
        {
            m_spacingEditor.Min = 5;
            m_spacingEditor.Max = 40;
            m_spacingEditor.Init(m_terrainTool, m_terrainTool, Strong.PropertyInfo((ITerrainTool x) => x.Spacing), null, "Spacing");
        }

        if (m_zTestEditor != null)
        {
            m_zTestEditor.Init(m_terrainTool, m_terrainTool, Strong.PropertyInfo((ITerrainTool x) => x.EnableZTest), null, "ZTest");
        }

        if (m_handlesToggle != null)
        {
            m_handlesToggle.onValueChanged.AddListener(OnHandlesToggleValueChanged);
        }
    }
コード例 #17
0
        private void Awake()
        {
            m_editorsMap = IOC.Resolve <IEditorsMap>();
            m_editor     = IOC.Resolve <IRuntimeEditor>();
            m_editor.Object.ComponentAdded += OnComponentAdded;

            GameObject[] selectedObjects = m_editor.Selection.gameObjects;
            InputName.text = GetObjectName(selectedObjects);
            InputName.onEndEdit.AddListener(OnEndEditName);

            m_selectedGameObjects = m_editor.Selection.gameObjects.Select(go => new GameObjectWrapper(go)).ToArray();
            IsActiveEditor.Init(m_selectedGameObjects, Strong.PropertyInfo((GameObjectWrapper x) => x.IsActive), string.Empty);


            m_editor.IsBusy = true;
            LayersEditor.LoadLayers(layersInfo =>
            {
                m_editor.IsBusy = false;
                List <RangeOptions.Option> layers = new List <RangeOptions.Option>();

                foreach (LayersInfo.Layer layer in layersInfo.Layers)
                {
                    if (!string.IsNullOrEmpty(layer.Name))
                    {
                        layers.Add(new RangeOptions.Option(string.Format("{0}: {1}", layer.Index, layer.Name), layer.Index));
                    }
                }

                LayerEditor.Options = layers.ToArray();
                LayerEditor.Init(m_editor.Selection.gameObjects, Strong.PropertyInfo((GameObject x) => x.layer), string.Empty);

                List <List <Component> > groups = GetComponentGroups(selectedObjects);
                for (int i = 0; i < groups.Count; ++i)
                {
                    List <Component> group = groups[i];
                    CreateComponentEditor(group);
                }

                UnityEventHelper.AddListener(EditLayersButton, btn => btn.onClick, OnEditLayersClick);
            });
        }
コード例 #18
0
        public PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            MemberInfo massInfo               = Strong.PropertyInfo((Rigidbody x) => x.mass, "mass");
            MemberInfo dragInfo               = Strong.PropertyInfo((Rigidbody x) => x.drag, "drag");
            MemberInfo angularDragInfo        = Strong.PropertyInfo((Rigidbody x) => x.angularDrag, "angularDrag");
            MemberInfo useGravityInfo         = Strong.PropertyInfo((Rigidbody x) => x.useGravity, "useGravity");
            MemberInfo isKinematicInfo        = Strong.PropertyInfo((Rigidbody x) => x.isKinematic, "isKinematic");
            MemberInfo interpolationInfo      = Strong.PropertyInfo((Rigidbody x) => x.interpolation, "interpolation");
            MemberInfo collisionDetectionInfo = Strong.PropertyInfo((Rigidbody x) => x.collisionDetectionMode, "collisionDetectionMode");

            return(new[]
            {
                new PropertyDescriptor("Mass", editor.Component, massInfo, massInfo),
                new PropertyDescriptor("Drag", editor.Component, dragInfo, dragInfo),
                new PropertyDescriptor("Angular Drag", editor.Component, angularDragInfo, angularDragInfo),
                new PropertyDescriptor("Use Gravity", editor.Component, useGravityInfo, useGravityInfo),
                new PropertyDescriptor("Is Kinematic", editor.Component, isKinematicInfo, isKinematicInfo),
                new PropertyDescriptor("Interpolation", editor.Component, interpolationInfo, interpolationInfo),
                new PropertyDescriptor("Collision Detection", editor.Component, collisionDetectionInfo, collisionDetectionInfo),
            });
        }
コード例 #19
0
        private void OnEnableDisable(bool enable)
        {
            //Wrong? how does it work?
            PropertyInfo prop = Strong.PropertyInfo((GameObjectEditor x) => x.IsGameObjectActive, "IsGameObjectActive");

            m_editor.Undo.BeginRecord();
            GameObject[] gameObjects = m_editor.Selection.gameObjects;
            for (int i = 0; i < gameObjects.Length; ++i)
            {
                GameObject go = gameObjects[i];
                if (go == null)
                {
                    continue;
                }

                m_editor.Undo.BeginRecordValue(go, this, prop);
                go.SetActive(enable);
                m_editor.Undo.EndRecordValue(go, this, prop, null);
            }
            m_editor.Undo.EndRecord();
        }
コード例 #20
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo clipInfo    = Strong.PropertyInfo((AudioSource x) => x.clip, "clip");
            MemberInfo volumeInfo  = Strong.PropertyInfo((AudioSource x) => x.volume, "volume");
            MemberInfo loopInfo    = Strong.PropertyInfo((AudioSource x) => x.loop, "loop");
            MemberInfo playOnAwake = Strong.PropertyInfo((AudioSource x) => x.playOnAwake, "playOnAwake");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_AudioSource_Loop", "Loop"), editor.Components, loopInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_AudioSource_PlayOnAwake", "Play On Awake"), editor.Components, playOnAwake),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_AudioSource_Clip", "Clip"), editor.Components, clipInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_AudioSource_Volume", "Volume"), editor.Components, volumeInfo, volumeInfo,
                                       null, new Range(0.0f, 1.0f))
                {
                    AnimationPropertyName = "m_Volume"
                },
            });
        }
コード例 #21
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            object[] converters = (object[])converter;

            ILocalization lc = IOC.Resolve <ILocalization>();

            PropertyEditorCallback valueChanged     = () => editor.BuildEditor();
            MemberInfo             projection       = Strong.PropertyInfo((CameraPropertyConverter x) => x.Projection, "Projection");
            MemberInfo             orthographic     = Strong.PropertyInfo((Camera x) => x.orthographic, "orthographic");
            MemberInfo             fov              = Strong.PropertyInfo((Camera x) => x.fieldOfView, "fieldOfView");
            MemberInfo             orthographicSize = Strong.PropertyInfo((Camera x) => x.orthographicSize, "orthographicSize");

            List <PropertyDescriptor> descriptors = new List <PropertyDescriptor>();

            descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Projection", "Projection"), converters, projection, orthographic, valueChanged));

            Camera[] cameras = editor.NotNullComponents.OfType <Camera>().ToArray();
            if (cameras.Length > 0)
            {
                bool isCameraOrthographic = cameras[0].orthographic;
                for (int i = 1; i < cameras.Length; ++i)
                {
                    if (cameras[i].orthographic != isCameraOrthographic)
                    {
                        return(descriptors.ToArray());
                    }
                }

                if (!isCameraOrthographic)
                {
                    descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Fov", "Field Of View"), editor.Components, fov, "field of view"));
                }
                else
                {
                    descriptors.Add(new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Camera_Size", "Size"), editor.Components, orthographicSize, "orthographic size"));
                }
            }

            return(descriptors.ToArray());
        }
コード例 #22
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            PropertyEditorCallback valueChanged = () => editor.BuildEditor();

            MemberInfo convexInfo    = Strong.PropertyInfo((MeshCollider x) => x.convex, "convex");
            MemberInfo isTriggerInfo = Strong.PropertyInfo((MeshCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo  = Strong.PropertyInfo((MeshCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo meshInfo      = Strong.PropertyInfo((MeshCollider x) => x.sharedMesh, "sharedMesh");

            MeshCollider collider = (MeshCollider)editor.Component;

            if (collider.convex)
            {
                return(new[]
                {
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Convex", "Convex"), editor.Component, convexInfo, convexInfo, valueChanged)
                    {
                        AnimationPropertyName = "m_Convex"
                    },
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_IsTrigger", "Is Trigger"), editor.Component, isTriggerInfo, "m_IsTrigger"),
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Material", "Material"), editor.Component, materialInfo, materialInfo),
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Mesh", "Mesh"), editor.Component, meshInfo, meshInfo),
                });
            }
            else
            {
                return(new[]
                {
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Convex", "Convex"), editor.Component, convexInfo, convexInfo, valueChanged)
                    {
                        AnimationPropertyName = "m_Convex"
                    },
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Material", "Material"), editor.Component, materialInfo, materialInfo),
                    new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_MeshCollider_Mesh", "Mesh"), editor.Component, meshInfo, meshInfo),
                });
            }
        }
コード例 #23
0
ファイル: TerrainEditor.cs プロジェクト: lbm7926/Imp
        private void Awake()
        {
            m_editor = IOC.Resolve <IRTE>();
            m_wm     = IOC.Resolve <IWindowManager>();

            Projector = Instantiate(m_terrainProjectorPrefab, m_editor.Root);
            Projector.gameObject.SetActive(false);

            if (m_editorSelector != null)
            {
                m_editorSelector.Init(this, this, Strong.PropertyInfo((TerrainEditor x) => x.EditorType), null, "Tool");
            }

            if (m_enableToggle != null)
            {
                m_enableToggle.onValueChanged.AddListener(OnEnableValueChanged);
                if (m_enableToggle.isOn)
                {
                    OnEnableValueChanged(m_enableToggle.isOn);
                }
            }
        }
コード例 #24
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converterObj)
        {
            CapsuleColliderPropertyConverter converter = (CapsuleColliderPropertyConverter)converterObj;

            MemberInfo isTriggerInfo          = Strong.PropertyInfo((CapsuleCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo           = Strong.PropertyInfo((CapsuleCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo centerInfo             = Strong.PropertyInfo((CapsuleCollider x) => x.center, "center");
            MemberInfo radiusInfo             = Strong.PropertyInfo((CapsuleCollider x) => x.radius, "radius");
            MemberInfo heightInfo             = Strong.PropertyInfo((CapsuleCollider x) => x.height, "height");
            MemberInfo directionInfo          = Strong.PropertyInfo((CapsuleCollider x) => x.direction, "direction");
            MemberInfo directionConvertedInfo = Strong.PropertyInfo((CapsuleColliderPropertyConverter x) => x.Direction, "Direction");

            return(new[]
            {
                new PropertyDescriptor("Is Trigger", editor.Component, isTriggerInfo, isTriggerInfo),
                new PropertyDescriptor("Material", editor.Component, materialInfo, materialInfo),
                new PropertyDescriptor("Center", editor.Component, centerInfo, centerInfo),
                new PropertyDescriptor("Radius", editor.Component, radiusInfo, radiusInfo),
                new PropertyDescriptor("Height", editor.Component, heightInfo, heightInfo),
                new PropertyDescriptor("Direction", converter, directionConvertedInfo, directionInfo),
            });
        }
コード例 #25
0
        private void OnEndMove(BaseHandle positionHandle)
        {
            if (m_tool.Mode != ProBuilderToolMode.PolyShape)
            {
                return;
            }
            if (m_polyShape.Stage == 0)
            {
                return;
            }
            if (m_rte.Selection.activeGameObject != m_pivot.gameObject)
            {
                return;
            }

            positionHandle.EnableUndo = true;

            m_rte.Undo.BeginRecord();
            m_rte.Undo.EndRecordTransform(m_pivot);
            m_rte.Undo.RecordValue(m_polyShape, Strong.PropertyInfo((PBPolyShape x) => x.SelectedPosition));
            m_rte.Undo.EndRecord();
        }
コード例 #26
0
        private void Awake()
        {
            m_localization = IOC.Resolve <ILocalization>();

            if (m_createLayer != null)
            {
                m_createLayer.onClick.AddListener(OnCreateLayer);
            }
            if (m_replaceLayer != null)
            {
                m_replaceLayer.onClick.AddListener(OnReplaceLayer);
            }
            if (m_removeLayer != null)
            {
                m_removeLayer.onClick.AddListener(OnRemoveLayer);
            }

            if (m_layersList != null)
            {
                m_layersList.SelectionChanged += OnLayersSelectionChanged;
                m_layersList.ItemDataBinding  += OnLayersDataBinding;
                m_layersList.CanDrag           = false;
                m_layersList.CanEdit           = false;
                m_layersList.CanRemove         = false;
                m_layersList.CanReorder        = false;
                m_layersList.CanReparent       = false;
                m_layersList.CanSelectAll      = false;
            }

            if (m_tileSizeEditor != null)
            {
                m_tileSizeEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileSize), null, m_localization.GetString("ID_RTTerrain_TerrainLayerEditor_TileSize", "Tile Size"), null, null, null, false, null, BeginRecordLayerProperties, EndRecordLayerProperties);
            }
            if (m_tileOffsetEditor != null)
            {
                m_tileOffsetEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileOffset), null, m_localization.GetString("ID_RTTerrain_TerrainLayerEditor_TileOffset", "Tile Offset"), null, null, null, false, null, BeginRecordLayerProperties, EndRecordLayerProperties);
            }
        }
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converter)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            MemberInfo massInfo               = Strong.PropertyInfo((Rigidbody x) => x.mass, "mass");
            MemberInfo dragInfo               = Strong.PropertyInfo((Rigidbody x) => x.drag, "drag");
            MemberInfo angularDragInfo        = Strong.PropertyInfo((Rigidbody x) => x.angularDrag, "angularDrag");
            MemberInfo useGravityInfo         = Strong.PropertyInfo((Rigidbody x) => x.useGravity, "useGravity");
            MemberInfo isKinematicInfo        = Strong.PropertyInfo((Rigidbody x) => x.isKinematic, "isKinematic");
            MemberInfo interpolationInfo      = Strong.PropertyInfo((Rigidbody x) => x.interpolation, "interpolation");
            MemberInfo collisionDetectionInfo = Strong.PropertyInfo((Rigidbody x) => x.collisionDetectionMode, "collisionDetectionMode");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_Mass", "Mass"), editor.Components, massInfo, "m_Mass"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_Drag", "Drag"), editor.Components, dragInfo, "m_Drag"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_AngularDrag", "Angular Drag"), editor.Components, angularDragInfo, "m_AngularDrag"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_UseGravity", "Use Gravity"), editor.Components, useGravityInfo, "m_UseGravity"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_IsKinematic", "Is Kinematic"), editor.Components, isKinematicInfo, "m_IsKinematic"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_Interpolation", "Interpolation"), editor.Components, interpolationInfo, interpolationInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_Rigidbody_CollisionDetection", "Collision Detection"), editor.Components, collisionDetectionInfo, collisionDetectionInfo)
            });
        }
コード例 #28
0
        private void OnEndScale(BaseHandle scaleHandle)
        {
            IMeshEditor meshEditor = GetEditor();

            if (meshEditor != null)
            {
                scaleHandle.EnableUndo = true;
                meshEditor.EndScale();

                Vector3    newScale = m_pivot.localScale;
                Quaternion rotation = m_pivot.rotation;
                m_pivot.localScale = Vector3.one;

                if (UVEditingMode)
                {
                    m_rte.Undo.EndRecordValue(UV, Strong.PropertyInfo((PBAutoUnwrapSettings x) => x.scale));
                }
                else
                {
                    m_rte.Undo.CreateRecord(record =>
                    {
                        meshEditor.BeginScale();
                        meshEditor.Scale(newScale, rotation);
                        meshEditor.EndScale();
                        return(true);
                    },
                                            record =>
                    {
                        meshEditor.BeginScale();
                        meshEditor.Scale(new Vector3(1.0f / newScale.x, 1.0f / newScale.y, 1.0f / newScale.z), rotation);
                        meshEditor.EndRotate();
                        return(true);
                    });
                }
            }
        }
コード例 #29
0
        public override PropertyDescriptor[] GetProperties(ComponentEditor editor, object converterObj)
        {
            ILocalization lc = IOC.Resolve <ILocalization>();

            CapsuleColliderPropertyConverter converter = (CapsuleColliderPropertyConverter)converterObj;

            MemberInfo isTriggerInfo          = Strong.PropertyInfo((CapsuleCollider x) => x.isTrigger, "isTrigger");
            MemberInfo materialInfo           = Strong.PropertyInfo((CapsuleCollider x) => x.sharedMaterial, "sharedMaterial");
            MemberInfo centerInfo             = Strong.PropertyInfo((CapsuleCollider x) => x.center, "center");
            MemberInfo radiusInfo             = Strong.PropertyInfo((CapsuleCollider x) => x.radius, "radius");
            MemberInfo heightInfo             = Strong.PropertyInfo((CapsuleCollider x) => x.height, "height");
            MemberInfo directionInfo          = Strong.PropertyInfo((CapsuleCollider x) => x.direction, "direction");
            MemberInfo directionConvertedInfo = Strong.PropertyInfo((CapsuleColliderPropertyConverter x) => x.Direction, "Direction");

            return(new[]
            {
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_CapsuleCollider_IsTrigger", "Is Trigger"), editor.Component, isTriggerInfo, "m_IsTrigger"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_CapsuleCollider_Material", "Material"), editor.Component, materialInfo),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_CapsuleCollider_Center", "Center"), editor.Component, centerInfo, "m_Center"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_CapsuleCollider_Radius", "Radius"), editor.Component, radiusInfo, "m_Radius"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_CapsuleCollider_Height", "Height"), editor.Component, heightInfo, "m_Height"),
                new PropertyDescriptor(lc.GetString("ID_RTEditor_CD_CapsuleCollider_Direction", "Direction"), converter, directionConvertedInfo, "m_Direction"),
            });
        }
コード例 #30
0
        private void Awake()
        {
            if (m_createLayer != null)
            {
                m_createLayer.onClick.AddListener(OnCreateLayer);
            }
            if (m_replaceLayer != null)
            {
                m_replaceLayer.onClick.AddListener(OnReplaceLayer);
            }
            if (m_removeLayer != null)
            {
                m_removeLayer.onClick.AddListener(OnRemoveLayer);
            }

            if (m_layersList != null)
            {
                m_layersList.SelectionChanged += OnLayersSelectionChanged;
                m_layersList.ItemDataBinding  += OnLayersDataBinding;
                m_layersList.CanDrag           = false;
                m_layersList.CanEdit           = false;
                m_layersList.CanRemove         = false;
                m_layersList.CanReorder        = false;
                m_layersList.CanReparent       = false;
                m_layersList.CanSelectAll      = false;
            }

            if (m_tileSizeEditor != null)
            {
                m_tileSizeEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileSize));
            }
            if (m_tileOffsetEditor != null)
            {
                m_tileOffsetEditor.Init(this, this, Strong.PropertyInfo((TerrainLayerEditor x) => x.TileOffset));
            }
        }
コード例 #31
0
 public void StartStrong(Strong s)
 {
     writer.Write("<strong>");
 }
コード例 #32
0
 public void StartStrong(Strong s)
 {
     if (strongCnt == 0)
         Write("**");
     strongCnt++;
 }
コード例 #33
0
 public void EndStrong(Strong s)
 {
     strongCnt--;
     if (strongCnt == 0)
         Write("**");
 }
コード例 #34
0
 public void EndStrong(Strong s)
 {
     indent -= IndentBy;
 }
コード例 #35
0
 public void StartStrong(Strong s)
 {
     Write("strong");
     indent += IndentBy;
 }
コード例 #36
0
        private static void SetInlineContent(INodeContainer<CommonMark.Inline> owner, Syntax.Inline inl)
        {
            while (inl != null)
            {
                CommonMark.Inline result = null;
                switch (inl.Tag)
                {
                    case Syntax.InlineTag.String:
                        result = new Text(inl.Content.Literal); break;
                    case Syntax.InlineTag.SoftBreak:
                        result = new Softbreak(); break;
                    case Syntax.InlineTag.LineBreak:
                        result = new Linebreak(); break;
                    case Syntax.InlineTag.Code:
                        result = new CodeSpan(inl.Content.Literal); break;
                    case Syntax.InlineTag.RawHtml:
                        result = new RawHtml(inl.Content.Literal); break;
                    case Syntax.InlineTag.Entity:
                        result = new TextEntity(inl.Content.Literal); break;
                    case Syntax.InlineTag.Emphasis:
                        result = new Emphasis(); break;
                    case Syntax.InlineTag.Strong:
                        result = new Strong(); break;
                    case Syntax.InlineTag.Link:
                        result = new Link(); break;
                    case Syntax.InlineTag.Image:
                        result = new Image(); break;
                    default:
                        throw new Exception("Invalid value for InlineTag");
                }
                if (result is Linkable)
                {
                    ((Linkable)result).Title = inl.Content.Linkable.Title;
                    ((Linkable)result).Url = inl.Content.Linkable.Url;
                    SetInlineContent((Linkable)result, inl.Content.Linkable.Label);
                }

                if (result is CommonMark.INodeContainer<CommonMark.Inline>)
                    SetInlineContent((CommonMark.INodeContainer<CommonMark.Inline>)result, inl.Content.Inlines);

                if (result != null)
                    owner.Append(result);

                inl = inl.Next;
            }
        }
コード例 #37
0
        public MaterialPropertyDescriptor[] GetProperties(MaterialEditor editor, object converterObject)
        {
            PropertyEditorCallback         valueChangedCallback = () => editor.BuildEditor();
            StandardMaterialValueConverter converter            = (StandardMaterialValueConverter)converterObject;

            PropertyInfo modeInfo          = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.Mode, "Mode");
            PropertyInfo cutoffInfo        = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.Cutoff, "Cutoff");
            PropertyInfo metallicMapInfo   = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.MetallicGlossMap, "MetallicGlossMap");
            PropertyInfo bumpMapInfo       = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.BumpMap, "BumpMap");
            PropertyInfo parallaxMapInfo   = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.ParallaxMap, "ParallaxMap");
            PropertyInfo occlusionMapInfo  = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.OcclusionMap, "OcclusionMap");
            PropertyInfo emissionMapInfo   = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.EmissionMap, "EmissionMap");
            PropertyInfo emissionColorInfo = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.EmissionColor, "EmissionColor");
            PropertyInfo detailMaskInfo    = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.DetailMask, "DetailMask");
            PropertyInfo detailAlbedoMap   = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.DetailAlbedoMap, "DetailAlbedoMap");
            PropertyInfo detailNormalMap   = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.DetailNormalMap, "DetailNormalMap");
            // PropertyInfo uvSecondaryInfo = Strong.PropertyInfo((StandardMaterialValueConverter x) => x.UVSecondary);

            PropertyInfo texInfo   = Strong.PropertyInfo((MaterialPropertyAccessor x) => x.Texture, "Texture");
            PropertyInfo colorInfo = Strong.PropertyInfo((MaterialPropertyAccessor x) => x.Color, "Color");
            PropertyInfo floatInfo = Strong.PropertyInfo((MaterialPropertyAccessor x) => x.Float, "Float");

            BlendMode mode = GetBlendMode(editor.Material);
            List <MaterialPropertyDescriptor> properties = new List <MaterialPropertyDescriptor>();

            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Rendering Mode", RTShaderPropertyType.Float, modeInfo, new RuntimeShaderInfo.RangeLimits(), TextureDimension.None, valueChangedCallback, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _MainTex), "Albedo", RTShaderPropertyType.TexEnv, texInfo, new RuntimeShaderInfo.RangeLimits(), TextureDimension.Tex2D, null, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _Color), "Albedo Color", RTShaderPropertyType.Color, colorInfo, new RuntimeShaderInfo.RangeLimits(), TextureDimension.None, null, EraseAccessorTarget));
            if (mode == BlendMode.Cutout)
            {
                properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Alpha Cutoff", RTShaderPropertyType.Range, cutoffInfo, new RuntimeShaderInfo.RangeLimits(0.5f, 0.0f, 1.0f), TextureDimension.None, null, EraseAccessorTarget));
            }

            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Metallic", RTShaderPropertyType.TexEnv, metallicMapInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, valueChangedCallback, EraseAccessorTarget));
            bool hasGlossMap = IsMetallicGlossMapSet(editor.Material);

            if (!hasGlossMap)
            {
                properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _Metallic), "Metallic", RTShaderPropertyType.Range, floatInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 1.0f), TextureDimension.None, null, EraseAccessorTarget));
                if (StandardMaterialValueConverter.GetSmoothnessMapChannel(editor.Material) == StandardMaterialValueConverter.SmoothnessMapChannel.SpecularMetallicAlpha)
                {
                    properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _Glossiness), "Smoothness", RTShaderPropertyType.Range, floatInfo, new RuntimeShaderInfo.RangeLimits(0.5f, 0.0f, 1.0f), TextureDimension.None, null, EraseAccessorTarget));
                }
                else
                {
                    properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _GlossMapScale), "Smoothness", RTShaderPropertyType.Range, floatInfo, new RuntimeShaderInfo.RangeLimits(1.0f, 0.0f, 1.0f), TextureDimension.None, null, EraseAccessorTarget));
                }
            }
            else
            {
                properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _GlossMapScale), "Smoothness", RTShaderPropertyType.Range, floatInfo, new RuntimeShaderInfo.RangeLimits(1.0f, 0.0f, 1.0f), TextureDimension.None, null, EraseAccessorTarget));
            }


            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Normal Map", RTShaderPropertyType.TexEnv, bumpMapInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, valueChangedCallback, EraseAccessorTarget));
            if (converter.BumpMap != null)
            {
                properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _BumpScale), "Normal Map Scale", RTShaderPropertyType.Float, floatInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.None, null, EraseAccessorTarget));
            }

            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Height Map", RTShaderPropertyType.TexEnv, parallaxMapInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, valueChangedCallback, EraseAccessorTarget));
            if (converter.ParallaxMap != null)
            {
                properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _Parallax), "Height Map Scale", RTShaderPropertyType.Range, floatInfo, new RuntimeShaderInfo.RangeLimits(0.02f, 0.005f, 0.08f), TextureDimension.None, null, EraseAccessorTarget));
            }

            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Occlusion Map", RTShaderPropertyType.TexEnv, occlusionMapInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, valueChangedCallback, EraseAccessorTarget));
            if (converter.OcclusionMap != null)
            {
                properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _OcclusionStrength), "Occlusion Strength", RTShaderPropertyType.Range, floatInfo, new RuntimeShaderInfo.RangeLimits(1.0f, 0, 1.0f), TextureDimension.None, null, EraseAccessorTarget));
            }

            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Emission Map", RTShaderPropertyType.TexEnv, emissionMapInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, null, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Emission Color", RTShaderPropertyType.Color, emissionColorInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.None, null, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Detail Mask", RTShaderPropertyType.TexEnv, detailMaskInfo, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, null, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Detail Albedo Map", RTShaderPropertyType.TexEnv, detailAlbedoMap, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, null, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, converter, "Detail Normal Map", RTShaderPropertyType.TexEnv, detailNormalMap, new RuntimeShaderInfo.RangeLimits(0.0f, 0.0f, 0.0f), TextureDimension.Tex2D, null, EraseAccessorTarget));
            properties.Add(new MaterialPropertyDescriptor(editor.Material, new MaterialPropertyAccessor(editor.Material, _DetailNormalMapScale), "Detail Scale", RTShaderPropertyType.Float, floatInfo, new RuntimeShaderInfo.RangeLimits(0, 0, 0), TextureDimension.None, null, EraseAccessorTarget));

            return(properties.ToArray());
        }
コード例 #38
0
 public void EndStrong(Strong s)
 {
     writer.Write("</strong>");
 }