|
@@ -22,10 +22,17 @@ namespace GFGGame
|
|
private GameObject _sceneObject;
|
|
private GameObject _sceneObject;
|
|
private GameObject _scenePrefab;
|
|
private GameObject _scenePrefab;
|
|
|
|
|
|
|
|
+ private GameObject _gameObject;
|
|
|
|
+ private GameObject _gameObject1;
|
|
|
|
+ private GoWrapper _wrapper;
|
|
|
|
+
|
|
private StoryFightResultData _resultData;
|
|
private StoryFightResultData _resultData;
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject1);
|
|
|
|
+
|
|
if (_scenePrefab != null)
|
|
if (_scenePrefab != null)
|
|
{
|
|
{
|
|
GameObject.Destroy(_scenePrefab);
|
|
GameObject.Destroy(_scenePrefab);
|
|
@@ -36,6 +43,7 @@ namespace GFGGame
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
}
|
|
}
|
|
_ui = null;
|
|
_ui = null;
|
|
|
|
+
|
|
base.Dispose();
|
|
base.Dispose();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -54,6 +62,9 @@ namespace GFGGame
|
|
base.OnInit();
|
|
base.OnInit();
|
|
_ui.m_btnClose.enabled = false;
|
|
_ui.m_btnClose.enabled = false;
|
|
_ui.m_btnClose.onClick.Add(OnClickBtnClose);
|
|
_ui.m_btnClose.onClick.Add(OnClickBtnClose);
|
|
|
|
+
|
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_zhandou", "ui_zd_zdjs_jdt");
|
|
|
|
+ SceneController.AddObjectToView(_gameObject1, null, _ui.m_expBar.m_pbExp.m_holder, resPath, out _gameObject1, out GoWrapper wrapper);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -71,11 +82,15 @@ namespace GFGGame
|
|
_ui.m_selfScore.m_txtScore.text = "" + _resultData.Score;
|
|
_ui.m_selfScore.m_txtScore.text = "" + _resultData.Score;
|
|
_ui.m_expBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
|
|
_ui.m_expBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
|
|
RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
|
|
RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
|
|
- _ui.m_expBar.m_pbExp.max = roleLevelCfg.exp;
|
|
|
|
- _ui.m_expBar.m_pbExp.value = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
|
|
|
|
|
|
+ // _ui.m_expBar.m_pbExp.max = roleLevelCfg.exp;
|
|
|
|
+ // _ui.m_expBar.m_pbExp.value = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
|
|
|
|
|
|
StoryUtil.UpdateStar(_resultData.Star, _ui.m_selfScore.m_flower.target);
|
|
StoryUtil.UpdateStar(_resultData.Star, _ui.m_selfScore.m_flower.target);
|
|
- _ui.m_selfScore.m_bg.url = "ui://Main/zd_jsjm_jszi_" + _resultData.Star;
|
|
|
|
|
|
+
|
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_zhandou", string.Format("zd_zdjs_{0}", _resultData.Star));
|
|
|
|
+ SceneController.AddObjectToView(_gameObject, _wrapper, _ui.m_selfScore.m_holder, resPath, out _gameObject, out _wrapper, 120);
|
|
|
|
+
|
|
|
|
+ // _ui.m_selfScore.m_bg.url = "ui://Main/zd_jsjm_jszi_" + _resultData.Star;
|
|
TextFormat tf = _ui.m_selfScore.m_txtScore.textFormat;
|
|
TextFormat tf = _ui.m_selfScore.m_txtScore.textFormat;
|
|
UpdateToCheckGuide(null);
|
|
UpdateToCheckGuide(null);
|
|
if (!this._resultData.Result)
|
|
if (!this._resultData.Result)
|
|
@@ -123,13 +138,22 @@ namespace GFGGame
|
|
|
|
|
|
private void AddExp(object param)
|
|
private void AddExp(object param)
|
|
{
|
|
{
|
|
- _ui.m_expBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
|
|
|
|
- int exp = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
|
|
|
|
- if (exp <= _ui.m_expBar.m_pbExp.value)
|
|
|
|
|
|
+ int lv = GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
|
|
|
|
+ _ui.m_expBar.m_txtLvl.text = lv.ToString();
|
|
|
|
+ float exp = GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
|
|
|
|
+ float cfgExp = RoleLevelCfgArray.Instance.GetCfg(lv).exp;
|
|
|
|
+ float initWidth = _ui.m_expBar.m_pbExp.m_bar.target.initWidth;
|
|
|
|
+ float curWidth = _ui.m_expBar.m_pbExp.m_bar.target.width;
|
|
|
|
+ float width = exp / cfgExp * initWidth;
|
|
|
|
+ if (width <= curWidth)
|
|
{
|
|
{
|
|
- _ui.m_expBar.m_pbExp.value = 0;
|
|
|
|
|
|
+ _ui.m_expBar.m_pbExp.m_bar.target.width = 0;
|
|
}
|
|
}
|
|
- _ui.m_expBar.m_pbExp.TweenValue(exp, 0.2f);
|
|
|
|
|
|
+ GTween.To(_ui.m_expBar.m_pbExp.m_bar.target.width, width, 0.2f).SetTarget(_ui.m_expBar.m_pbExp.m_bar).OnUpdate((GTweener t) =>
|
|
|
|
+ {
|
|
|
|
+ _ui.m_expBar.m_pbExp.m_bar.target.width = t.value.x;
|
|
|
|
+ }); ;
|
|
|
|
+ // _ui.m_expBar.m_pbExp..TweenValue(exp, 0.2f);
|
|
_ui.m_btnClose.enabled = true;
|
|
_ui.m_btnClose.enabled = true;
|
|
|
|
|
|
}
|
|
}
|