feat: 게임 플레이 화면에서 벗어나면 정보 초기화
This commit is contained in:
@@ -12,7 +12,7 @@ namespace TON
|
|||||||
public float PlayTime => Time.time - stageStartTime;
|
public float PlayTime => Time.time - stageStartTime;
|
||||||
public int goldReward { get; private set; } = 0; // 골드 획득 보상
|
public int goldReward { get; private set; } = 0; // 골드 획득 보상
|
||||||
public int expReward { get; private set; } = 0; // 경험치 획득 보상
|
public int expReward { get; private set; } = 0; // 경험치 획득 보상
|
||||||
public int waveCount { get; private set; } // 클리어한 웨이브 넘버
|
public int waveCount { get; private set; } = 0; // 클리어한 웨이브 넘버
|
||||||
public int gameScore { get; private set; } = 0; // 몬스터 처치로 얻은 점수 보상
|
public int gameScore { get; private set; } = 0; // 몬스터 처치로 얻은 점수 보상
|
||||||
|
|
||||||
private float stageStartTime; // 스테이지 시작 시간
|
private float stageStartTime; // 스테이지 시작 시간
|
||||||
@@ -79,6 +79,12 @@ namespace TON
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetPlayData()
|
||||||
|
{
|
||||||
|
waveCount = 0;
|
||||||
|
goldReward = 0;
|
||||||
|
expReward = 0;
|
||||||
|
gameScore = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ namespace TON
|
|||||||
// UIManager.Hide<GameoverUI>(UIList.GameOverUI);
|
// UIManager.Hide<GameoverUI>(UIList.GameOverUI);
|
||||||
UIManager.Hide<PauseUI>(UIList.PauseUI);
|
UIManager.Hide<PauseUI>(UIList.PauseUI);
|
||||||
|
|
||||||
|
// 스테이지 종료 후 플레이한 데이터 초기화
|
||||||
|
StageManager.Singleton.ResetPlayData();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,8 +180,9 @@ namespace TON
|
|||||||
Debug.Log("OnClickAdButton::: ");
|
Debug.Log("OnClickAdButton::: ");
|
||||||
|
|
||||||
PlayerDataManager.Singleton.AddGold(goldAmount);
|
PlayerDataManager.Singleton.AddGold(goldAmount);
|
||||||
OnClickHomeButton();
|
goldAmount = 0;
|
||||||
|
|
||||||
|
OnClickHomeButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user