public Models.Paragraph Views(Novacode.Paragraph p, DocumentFormat.OpenXml.Wordprocessing.Paragraph p2) { var par = new Models.Paragraph(); par.Alignment = p.Alignment.ToString(); par.Text = p.Text; foreach (var m in p.MagicText) { var mt = new MagicText(); if (m.formatting.FontFamily != null) { mt.Font.Family = m.formatting.FontFamily.Name; } if (m.formatting.Size != null) { mt.Font.Size = (float)m.formatting.Size; } if (m.formatting.Bold != null) { mt.Font.Bold = m.formatting.Bold.Value; } if (m.formatting.Italic != null) { mt.Font.Italic = m.formatting.Italic.Value; } par.MagicText[m.text] = mt; } return(par); }
protected void OnEnable() { so = new SerializedObject(target); _enableAnim = so.FindProperty("enableAnim"); _unscaledTime = so.FindProperty("unscaledTime"); _playOnAwake = so.FindProperty("playOnAwake"); _awakeDelay = so.FindProperty("awakeDelay"); _loop_0 = so.FindProperty("loop_0"); _loopInterval_0 = so.FindProperty("loopInterval_0"); _isRandomForLoopInterval_0 = so.FindProperty("isRandomForLoopInterval_0"); _randomRangeForLoopInterval_0 = so.FindProperty("randomRangeForLoopInterval_0"); //layout _layout = so.FindProperty("layout"); _ctrl = target as MagicText; _italicFactor = so.FindProperty("italicFactor"); _radius = so.FindProperty("radius"); _angle = so.FindProperty("angle"); _perspectiveFactor = so.FindProperty("perspectiveFactor"); _strethFactor = so.FindProperty("strethFactor"); //fadein 第一阶段 _type_1 = so.FindProperty("type_1"); _perTextInterval_1 = so.FindProperty("perTextInterval_1"); _loopInterval_1 = so.FindProperty("loopInterval_1"); _animFactor_1 = so.FindProperty("animFactor_1"); _textColor_1 = so.FindProperty("textColor_1"); _perTextSpeed_1 = so.FindProperty("perTextSpeed_1"); _loop_1 = so.FindProperty("loop_1"); _isFadein_1 = so.FindProperty("fadein_1"); _animCurve_1 = so.FindProperty("animCurve_1"); _alphaCurve_1 = so.FindProperty("alphaCurve_1"); _isRandomForLoopInterval_1 = so.FindProperty("isRandomForLoopInterval_1"); _randomRangeForLoopInterval_1 = so.FindProperty("randomRangeForLoopInterval_1"); _openPosOffset_1 = so.FindProperty("openPosOffset_1"); _posOffset_1 = so.FindProperty("posOffset_1"); _order_1 = so.FindProperty("order_1"); //display 第二阶段 _stage_2 = so.FindProperty("stage_2"); _type_2 = so.FindProperty("type_2"); _perTextInterval_2 = so.FindProperty("perTextInterval_2"); _loopInterval_2 = so.FindProperty("loopInterval_2"); _animFactor_2 = so.FindProperty("animFactor_2"); _textColor_2 = so.FindProperty("textColor_2"); _perTextSpeed_2 = so.FindProperty("perTextSpeed_2"); _loop_2 = so.FindProperty("loop_2"); _animCurve_2 = so.FindProperty("animCurve_2"); _isRandomForLoopInterval_2 = so.FindProperty("isRandomForLoopInterval_2"); _randomRangeForLoopInterval_2 = so.FindProperty("randomRangeForLoopInterval_2"); _openPosOffset_2 = so.FindProperty("openPosOffset_2"); _posOffset_2 = so.FindProperty("posOffset_2"); _order_2 = so.FindProperty("order_2"); _waitForStageSwitch_2 = so.FindProperty("waitForStageSwitch_2"); //fadeout 第三阶段 _stage_3 = so.FindProperty("stage_3"); _type_3 = so.FindProperty("type_3"); _perTextInterval_3 = so.FindProperty("perTextInterval_3"); _loopInterval_3 = so.FindProperty("loopInterval_3"); _animFactor_3 = so.FindProperty("animFactor_3"); _textColor_3 = so.FindProperty("textColor_3"); _perTextSpeed_3 = so.FindProperty("perTextSpeed_3"); _loop_3 = so.FindProperty("loop_3"); _animCurve_3 = so.FindProperty("animCurve_3"); _isRandomForLoopInterval_3 = so.FindProperty("isRandomForLoopInterval_3"); _randomRangeForLoopInterval_3 = so.FindProperty("randomRangeForLoopInterval_3"); _openPosOffset_3 = so.FindProperty("openPosOffset_3"); _posOffset_3 = so.FindProperty("posOffset_3"); _order_3 = so.FindProperty("order_3"); _waitForStageSwitch_3 = so.FindProperty("waitForStageSwitch_3"); _forceFadeoutDelay_3 = so.FindProperty("forceFadeoutDelay_3"); _forceFadeoutTime_3 = so.FindProperty("forceFadeoutTime_3"); }