示例#1
0
        public Vector2 EditVector2(String name, Vector2 defaultValue)
        {
            try
            {
                AssetDefinition assetDef = m_editAsset.Content;
                if (assetDef.Fields.ContainsKey(name) && assetDef.Fields[name] is AssetDefinition)
                {
                    AssetDefinition vecAssetDef = assetDef.Fields[name] as AssetDefinition;
                    return(new Vector2(vecAssetDef.AsFloat("X"), vecAssetDef.AsFloat("Y")));
                }
            }
            catch { }

            return(defaultValue);
        }
示例#2
0
        public float EditSingle(String name, float defaultValue = 0)
        {
            try
            {
                AssetDefinition assetDef = m_editAsset.Content;
                if (assetDef.Fields.ContainsKey(name))
                {
                    return(assetDef.AsFloat(name));
                }
            }
            catch { }

            return(defaultValue);
        }