|
@@ -10,6 +10,8 @@ namespace GFGGame
|
|
public class StoryFightSingleScoreView : BaseView
|
|
public class StoryFightSingleScoreView : BaseView
|
|
{
|
|
{
|
|
private UI_StoryFightSingleScoreUI _ui;
|
|
private UI_StoryFightSingleScoreUI _ui;
|
|
|
|
+ private GameObject _scenePrefab;
|
|
|
|
+ private GameObject _sceneObject;
|
|
private FightData roleData;
|
|
private FightData roleData;
|
|
private int _partId;//当前评分part
|
|
private int _partId;//当前评分part
|
|
private int _score;//当前总分数
|
|
private int _score;//当前总分数
|
|
@@ -71,12 +73,12 @@ namespace GFGGame
|
|
_ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
_ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
_ui.m_btnSpeedUp.onClick.Add(OnBtnSpeedUp);
|
|
_ui.m_btnSpeedUp.onClick.Add(OnBtnSpeedUp);
|
|
|
|
|
|
- // _ui.m_comClickCircle.target.onClick.Add(OnComClickCircle);
|
|
|
|
_ui.m_comClick.target.onClick.Add(CheckPerfectSkill);
|
|
_ui.m_comClick.target.onClick.Add(CheckPerfectSkill);
|
|
|
|
|
|
- _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("fightBg");
|
|
|
|
- _ui.m_LoaMask.url = ResPathUtil.GetBgImgPath("fightBg");
|
|
|
|
|
|
+ // _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("fightBg");
|
|
|
|
+ // _ui.m_LoaMask.url = ResPathUtil.GetBgImgPath("fightBg");
|
|
|
|
|
|
|
|
+ _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneFightSingleScore"));
|
|
AddEffect();
|
|
AddEffect();
|
|
}
|
|
}
|
|
private void AddEffect()
|
|
private void AddEffect()
|
|
@@ -103,13 +105,12 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
roleData = InstanceZonesDataManager.roleData;
|
|
roleData = InstanceZonesDataManager.roleData;
|
|
- // ScoreSystemData.Instance.SetEquipScoresWithPartId(roleData);
|
|
|
|
-
|
|
|
|
- _nTexture = new NTexture(FightDataManager.Instance.RoleTextuex);
|
|
|
|
-
|
|
|
|
- ET.Log.Debug("Screen:" + UnityEngine.Screen.width + " " + UnityEngine.Screen.height + " _nTexture:" + _nTexture.width + " " + _nTexture.height);
|
|
|
|
- _ui.m_imgRole.SetSize(GRoot.inst.width, GRoot.inst.height);
|
|
|
|
- _ui.m_imgRole.texture = _nTexture;
|
|
|
|
|
|
+ if (_sceneObject == null)
|
|
|
|
+ {
|
|
|
|
+ _sceneObject = GameObject.Instantiate(_scenePrefab);
|
|
|
|
+ MyDressUpHelper.dressUpObj.setSceneObj(_sceneObject, false, false, null, false);
|
|
|
|
+ }
|
|
|
|
+ MyDressUpHelper.dressUpObj.PutOnItemList(roleData.itemList);
|
|
|
|
|
|
if (!FightDataManager.Instance.autoPlay)
|
|
if (!FightDataManager.Instance.autoPlay)
|
|
{
|
|
{
|
|
@@ -129,7 +130,7 @@ namespace GFGGame
|
|
_ui.m_proScore.m_txtCount.text = "总分 0";
|
|
_ui.m_proScore.m_txtCount.text = "总分 0";
|
|
_ui.m_comClick.target.touchable = false;
|
|
_ui.m_comClick.target.touchable = false;
|
|
_ui.m_comAllPerfect.target.visible = false;
|
|
_ui.m_comAllPerfect.target.visible = false;
|
|
- _ui.m_LoaMask.visible = false;
|
|
|
|
|
|
+ // _ui.m_LoaMask.visible = false;
|
|
|
|
|
|
_currentTime = BeginTime.PART_ALL_FIGHT_BEGIN;
|
|
_currentTime = BeginTime.PART_ALL_FIGHT_BEGIN;
|
|
// _stopFight = false;
|
|
// _stopFight = false;
|
|
@@ -287,7 +288,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
FightDataManager.Instance.totalScore = _score;
|
|
FightDataManager.Instance.totalScore = _score;
|
|
_ui.m_proScore.m_txtCount.text = string.Format("总分 {0}", _score);
|
|
_ui.m_proScore.m_txtCount.text = string.Format("总分 {0}", _score);
|
|
- GetCurStar(out int star, out Transition transition);
|
|
|
|
|
|
+ GetCurStar(out int star);
|
|
_ui.m_proScore.m_comFirstScore.m_c1.selectedIndex = star > 0 ? 1 : 0;
|
|
_ui.m_proScore.m_comFirstScore.m_c1.selectedIndex = star > 0 ? 1 : 0;
|
|
_ui.m_proScore.m_comSecondScore.m_c1.selectedIndex = star > 1 ? 1 : 0;
|
|
_ui.m_proScore.m_comSecondScore.m_c1.selectedIndex = star > 1 ? 1 : 0;
|
|
_ui.m_proScore.m_comThirdScore.m_c1.selectedIndex = star > 2 ? 1 : 0;
|
|
_ui.m_proScore.m_comThirdScore.m_c1.selectedIndex = star > 2 ? 1 : 0;
|
|
@@ -308,7 +309,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- Timers.inst.Add(0.5f, 1, FightEnd);//评分结束
|
|
|
|
|
|
+ // Timers.inst.Add(0.5f, 1, FightEnd);//评分结束
|
|
|
|
+ Timers.inst.Add(0.3f, 1, Skip);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -319,15 +321,11 @@ namespace GFGGame
|
|
|
|
|
|
private void FightEnd(object param = null)
|
|
private void FightEnd(object param = null)
|
|
{
|
|
{
|
|
- _ui.m_comRoleResult.m_comRole.m_imgRole.SetSize(GRoot.inst.width, GRoot.inst.height);
|
|
|
|
- _ui.m_comRoleResult.m_comRole.m_imgRole.texture = _nTexture;
|
|
|
|
- _ui.m_comRoleResult.m_c1.selectedIndex = 0;
|
|
|
|
|
|
|
|
- _ui.m_comRoleResult.m_t0.Play();
|
|
|
|
- _ui.m_t1.Play(() =>
|
|
|
|
- {
|
|
|
|
- Timers.inst.Add(0.3f, 1, Skip);
|
|
|
|
- });
|
|
|
|
|
|
+ // _ui.m_t1.Play(() =>
|
|
|
|
+ // {
|
|
|
|
+ // Timers.inst.Add(0.3f, 1, Skip);
|
|
|
|
+ // });
|
|
}
|
|
}
|
|
|
|
|
|
private void AllCirclePlayStart()
|
|
private void AllCirclePlayStart()
|
|
@@ -380,26 +378,22 @@ namespace GFGGame
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- private void GetCurStar(out int star, out Transition transition)
|
|
|
|
|
|
+ private void GetCurStar(out int star)
|
|
{
|
|
{
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
star = 0;
|
|
star = 0;
|
|
- transition = _ui.m_comRoleResult.m_t0;
|
|
|
|
if (_score >= fightCfg.score1 && _score < fightCfg.score2)
|
|
if (_score >= fightCfg.score1 && _score < fightCfg.score2)
|
|
{
|
|
{
|
|
star = 1;
|
|
star = 1;
|
|
- transition = _ui.m_comRoleResult.m_t1;
|
|
|
|
}
|
|
}
|
|
else if (_score >= fightCfg.score2 && _score < fightCfg.score3)
|
|
else if (_score >= fightCfg.score2 && _score < fightCfg.score3)
|
|
{
|
|
{
|
|
star = 2;
|
|
star = 2;
|
|
- transition = _ui.m_comRoleResult.m_t2;
|
|
|
|
}
|
|
}
|
|
else if (_score >= fightCfg.score3)
|
|
else if (_score >= fightCfg.score3)
|
|
{
|
|
{
|
|
star = 3;
|
|
star = 3;
|
|
- transition = _ui.m_comRoleResult.m_t3;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -430,15 +424,6 @@ namespace GFGGame
|
|
Timers.inst.Remove(SkillScoreStart);
|
|
Timers.inst.Remove(SkillScoreStart);
|
|
Timers.inst.Remove(Skip);
|
|
Timers.inst.Remove(Skip);
|
|
GTween.Kill(_ui.m_proScore.m_comBar);
|
|
GTween.Kill(_ui.m_proScore.m_comBar);
|
|
- _ui.m_t1.Stop(true, false);
|
|
|
|
-
|
|
|
|
- _ui.m_comRoleResult.m_t0.Stop(true, false);
|
|
|
|
- _ui.m_comRoleResult.m_t1.Stop(true, false);
|
|
|
|
- _ui.m_comRoleResult.m_t2.Stop(true, false);
|
|
|
|
- _ui.m_comRoleResult.m_t3.Stop(true, false);
|
|
|
|
- _ui.m_comRoleResult.m_comRole.m_t0.Stop(true, false);
|
|
|
|
- _ui.m_comRoleResult.m_comRole.m_imgRole.alpha = 0;
|
|
|
|
- _ui.m_comRoleResult.target.SetScale(0, 0);
|
|
|
|
|
|
|
|
_ui.m_proScore.target.value = 0;
|
|
_ui.m_proScore.target.value = 0;
|
|
_ui.m_proScore.m_txtCount.text = "总分 0";
|
|
_ui.m_proScore.m_txtCount.text = "总分 0";
|
|
@@ -463,11 +448,11 @@ namespace GFGGame
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
- // if (_sceneObject != null)
|
|
|
|
- // {
|
|
|
|
- // GameObject.Destroy(_sceneObject);
|
|
|
|
- // _sceneObject = null;
|
|
|
|
- // }
|
|
|
|
|
|
+ if (_sceneObject != null)
|
|
|
|
+ {
|
|
|
|
+ GameObject.Destroy(_sceneObject);
|
|
|
|
+ _sceneObject = null;
|
|
|
|
+ }
|
|
|
|
|
|
Reset();
|
|
Reset();
|
|
}
|
|
}
|