인터넷 시간
This commit is contained in:
parent
afbcfc40bb
commit
ca0d0e23d3
|
|
@ -653,7 +653,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &6292328828743219470
|
--- !u!224 &6292328828743219470
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -704,7 +704,7 @@ MonoBehaviour:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
||||||
m_Type: 0
|
m_Type: 1
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
m_FillMethod: 4
|
m_FillMethod: 4
|
||||||
|
|
@ -946,7 +946,7 @@ MonoBehaviour:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
||||||
m_Type: 0
|
m_Type: 1
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
m_FillMethod: 4
|
m_FillMethod: 4
|
||||||
|
|
@ -1002,7 +1002,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &3190770213717081060
|
--- !u!224 &3190770213717081060
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -1054,7 +1054,7 @@ MonoBehaviour:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
||||||
m_Type: 0
|
m_Type: 1
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
m_FillMethod: 4
|
m_FillMethod: 4
|
||||||
|
|
@ -1412,7 +1412,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
m_AnchoredPosition: {x: -52, y: 0}
|
m_AnchoredPosition: {x: -76.9, y: 0}
|
||||||
m_SizeDelta: {x: 64, y: 64}
|
m_SizeDelta: {x: 64, y: 64}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &1864243643522392499
|
--- !u!222 &1864243643522392499
|
||||||
|
|
@ -2016,7 +2016,7 @@ MonoBehaviour:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 6facc842ead05744184e7db7ba064b48, type: 3}
|
||||||
m_Type: 0
|
m_Type: 1
|
||||||
m_PreserveAspect: 0
|
m_PreserveAspect: 0
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
m_FillMethod: 4
|
m_FillMethod: 4
|
||||||
|
|
|
||||||
|
|
@ -38628,7 +38628,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &559934552
|
--- !u!224 &559934552
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -64996,9 +64996,9 @@ RectTransform:
|
||||||
m_Father: {fileID: 1166114708}
|
m_Father: {fileID: 1166114708}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 0, y: 0}
|
||||||
m_AnchoredPosition: {x: 0, y: 0}
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
m_SizeDelta: {x: 0, y: 179.21582}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &922729938
|
--- !u!114 &922729938
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -74713,7 +74713,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!224 &1166114708
|
--- !u!224 &1166114708
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -6449,6 +6449,50 @@ CanvasRenderer:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1690578740}
|
m_GameObject: {fileID: 1690578740}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &1711243444
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1711243446}
|
||||||
|
- component: {fileID: 1711243445}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Time
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1711243445
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1711243444}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e806c67b86b115d458fefce3031e094c, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!4 &1711243446
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1711243444}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.43922746, y: -0.03640896, z: -0.03968414}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &1732641636
|
--- !u!1 &1732641636
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -6682,3 +6726,4 @@ SceneRoots:
|
||||||
- {fileID: 1494210000}
|
- {fileID: 1494210000}
|
||||||
- {fileID: 106099445}
|
- {fileID: 106099445}
|
||||||
- {fileID: 984795659}
|
- {fileID: 984795659}
|
||||||
|
- {fileID: 1711243446}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Globalization;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
|
||||||
|
public class InternetTime : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static InternetTime Ins;
|
||||||
|
private void Awake() { Ins = this; DontDestroyOnLoad(gameObject); }
|
||||||
|
|
||||||
|
public DateTime Time { get; private set; }
|
||||||
|
|
||||||
|
// 한국 표준시 = UTC+9
|
||||||
|
private static readonly TimeSpan KSTOffset = TimeSpan.FromHours(9);
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
StartCoroutine(GetKSTTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator Co_1Sec()
|
||||||
|
{
|
||||||
|
while ( true)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
Time = Time.AddSeconds(1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator GetKSTTime()
|
||||||
|
{
|
||||||
|
Time = DateTime.Now;
|
||||||
|
using (UnityWebRequest req = UnityWebRequest.Get("https://google.com"))
|
||||||
|
{
|
||||||
|
yield return req.SendWebRequest();
|
||||||
|
|
||||||
|
if (req.result == UnityWebRequest.Result.ConnectionError ||
|
||||||
|
req.result == UnityWebRequest.Result.ProtocolError)
|
||||||
|
{
|
||||||
|
Time = DateTime.Now;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string dateHeader = req.GetResponseHeader("date");
|
||||||
|
if (!string.IsNullOrEmpty(dateHeader))
|
||||||
|
{
|
||||||
|
// 서버가 준 시간은 UTC 기준
|
||||||
|
DateTime utcTime = DateTime.ParseExact(
|
||||||
|
dateHeader,
|
||||||
|
"ddd, dd MMM yyyy HH:mm:ss 'GMT'",
|
||||||
|
CultureInfo.InvariantCulture.DateTimeFormat,
|
||||||
|
DateTimeStyles.AssumeUniversal
|
||||||
|
);
|
||||||
|
|
||||||
|
Time = utcTime.ToUniversalTime() + KSTOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StartCoroutine(Co_1Sec());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e806c67b86b115d458fefce3031e094c
|
||||||
|
|
@ -49,6 +49,8 @@ public class ADSManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
// This callback is called once the MobileAds SDK is initialized.
|
// This callback is called once the MobileAds SDK is initialized.
|
||||||
|
|
||||||
|
adDictionary.Clear();
|
||||||
|
|
||||||
if (GameManager.DB.IsRemoveADS == false)
|
if (GameManager.DB.IsRemoveADS == false)
|
||||||
{
|
{
|
||||||
adDictionary.Add("Game_Interstitial", new InterstitialAd("ca-app-pub-6390804219581974/4957790852", "Game_Interstitial"));
|
adDictionary.Add("Game_Interstitial", new InterstitialAd("ca-app-pub-6390804219581974/4957790852", "Game_Interstitial"));
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ namespace CodeJay
|
||||||
{
|
{
|
||||||
public const int AI_IMAGE_NUMBER = 100;
|
public const int AI_IMAGE_NUMBER = 100;
|
||||||
|
|
||||||
public const int ADS_TIMER_COUNT = 180;
|
public const int ADS_TIMER_COUNT = 3600;
|
||||||
|
|
||||||
public const int ADS_REWARD_COUNT = 3;
|
public const int ADS_REWARD_COUNT = 3;
|
||||||
|
|
||||||
|
|
@ -881,7 +881,7 @@ public partial class DBManager : MonoBehaviour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = InternetTime.Ins.Time;
|
||||||
DateTime midnightToday = DateTime.Today.AddDays(1).AddTicks(-1);
|
DateTime midnightToday = DateTime.Today.AddDays(1).AddTicks(-1);
|
||||||
if (now.Hour == 23 && now.Minute >= 30)
|
if (now.Hour == 23 && now.Minute >= 30)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class TimerManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public int time = 0;
|
public int time = 0;
|
||||||
public int limiteTimerCount = 0;
|
public int limiteTimerCount = 0;
|
||||||
public DateTime saveTimeData = DateTime.Now;
|
public DateTime saveTimeData = InternetTime.Ins.Time;
|
||||||
public UnityAction<int> OnPassedTime;
|
public UnityAction<int> OnPassedTime;
|
||||||
|
|
||||||
protected TimerType timerType = TimerType.None;
|
protected TimerType timerType = TimerType.None;
|
||||||
|
|
@ -162,7 +162,7 @@ public class TimerManager : MonoBehaviour
|
||||||
SimpleTimerInfo info = timerInfoDictionary[dic.Key] as SimpleTimerInfo;
|
SimpleTimerInfo info = timerInfoDictionary[dic.Key] as SimpleTimerInfo;
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
info.saveTimeData = DateTime.Now;
|
info.saveTimeData = InternetTime.Ins.Time;
|
||||||
ES3.Save<SimpleTimerInfo>(sb.ToString(), info, "TimerData.json");
|
ES3.Save<SimpleTimerInfo>(sb.ToString(), info, "TimerData.json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -178,7 +178,7 @@ public class TimerManager : MonoBehaviour
|
||||||
HierarchyTimerInfo info = timerInfoDictionary[dic.Key] as HierarchyTimerInfo;
|
HierarchyTimerInfo info = timerInfoDictionary[dic.Key] as HierarchyTimerInfo;
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
info.saveTimeData = DateTime.Now;
|
info.saveTimeData = InternetTime.Ins.Time;
|
||||||
ES3.Save<HierarchyTimerInfo>(sb.ToString(), info, "TimerData.json");
|
ES3.Save<HierarchyTimerInfo>(sb.ToString(), info, "TimerData.json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -263,7 +263,7 @@ public class TimerManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (timerInfoDictionary[ownerName].saveTimeData != null && timerInfoDictionary[ownerName].saveTimeData.Year != 1)
|
if (timerInfoDictionary[ownerName].saveTimeData != null && timerInfoDictionary[ownerName].saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - timerInfoDictionary[ownerName].saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - timerInfoDictionary[ownerName].saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (limiteTimerCount - timerInfoDictionary[ownerName].time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (limiteTimerCount - timerInfoDictionary[ownerName].time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
@ -271,10 +271,10 @@ public class TimerManager : MonoBehaviour
|
||||||
timerCount = limiteTimerCount - totalPassedTimeSecond;
|
timerCount = limiteTimerCount - totalPassedTimeSecond;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 새로 타이머를 시작해야 한다.
|
// 새로 타이머를 시작해야 한다.
|
||||||
if (IsStartedTimer() == false)
|
if (IsStartedTimer() == false)
|
||||||
{
|
{
|
||||||
// 기존에 시작하는 타이머가 없다면 타이머를 시작한다.
|
// 기존에 시작하는 타이머가 없다면 타이머를 시작한다.
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,7 +317,7 @@ public class TimerManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (timerInfoDictionary[ownerName].saveTimeData != null && timerInfoDictionary[ownerName].saveTimeData.Year != 1)
|
if (timerInfoDictionary[ownerName].saveTimeData != null && timerInfoDictionary[ownerName].saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - timerInfoDictionary[ownerName].saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - timerInfoDictionary[ownerName].saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (limiteTimerCount - timerInfoDictionary[ownerName].time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (limiteTimerCount - timerInfoDictionary[ownerName].time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
@ -328,13 +328,13 @@ public class TimerManager : MonoBehaviour
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
timerInfoDictionary.Add(ownerName, new SimpleTimerInfo(ownerName, timerCount, DateTime.Now, OnStartTimer, OnPauseTimer, OnStopTimer, OnPassedTime));
|
timerInfoDictionary.Add(ownerName, new SimpleTimerInfo(ownerName, timerCount, InternetTime.Ins.Time, OnStartTimer, OnPauseTimer, OnStopTimer, OnPassedTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 새로 타이머를 시작해야 한다.
|
// 새로 타이머를 시작해야 한다.
|
||||||
if (IsStartedTimer() == false)
|
if (IsStartedTimer() == false)
|
||||||
{
|
{
|
||||||
// 기존에 시작하는 타이머가 없다면 타이머를 시작한다.
|
// 기존에 시작하는 타이머가 없다면 타이머를 시작한다.
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -375,12 +375,12 @@ public class TimerManager : MonoBehaviour
|
||||||
LoadHierarchyTimerInfo(ownerName);
|
LoadHierarchyTimerInfo(ownerName);
|
||||||
if (timerInfoDictionary.ContainsKey(ownerName) == true)
|
if (timerInfoDictionary.ContainsKey(ownerName) == true)
|
||||||
{
|
{
|
||||||
// 로드 한 정보가 있으면 작동 중인 타이머가 존재 하는 것
|
// 로드 한 정보가 있으면 작동 중인 타이머가 존재 하는 것
|
||||||
// 타이머 계산을 해야 한다.
|
// 타이머 계산을 해야 한다.
|
||||||
|
|
||||||
if (timerInfoDictionary[ownerName].saveTimeData != null && timerInfoDictionary[ownerName].saveTimeData.Year != 1)
|
if (timerInfoDictionary[ownerName].saveTimeData != null && timerInfoDictionary[ownerName].saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - timerInfoDictionary[ownerName].saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - timerInfoDictionary[ownerName].saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (limiteTimerCount - timerInfoDictionary[ownerName].time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (limiteTimerCount - timerInfoDictionary[ownerName].time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
@ -394,20 +394,20 @@ public class TimerManager : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 로드 된 정보에 따라 타이머가 바뀌어야 한다.
|
// 로드 된 정보에 따라 타이머가 바뀌어야 한다.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 로드 한 정보가 없으면 작동 중인 타이머가 없는 것
|
// 로드 한 정보가 없으면 작동 중인 타이머가 없는 것
|
||||||
|
|
||||||
// 새로 시작한 타이머의 정보를 등록해야 한다.
|
// 새로 시작한 타이머의 정보를 등록해야 한다.
|
||||||
timerInfoDictionary.Add(ownerName, new HierarchyTimerInfo(ownerName, timerCount, DateTime.Now, OnStartTimer, OnPauseTimer, OnStopTimer, OnPassedTime));
|
timerInfoDictionary.Add(ownerName, new HierarchyTimerInfo(ownerName, timerCount, InternetTime.Ins.Time, OnStartTimer, OnPauseTimer, OnStopTimer, OnPassedTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 새로 타이머를 시작해야 한다.
|
// 새로 타이머를 시작해야 한다.
|
||||||
if (IsStartedTimer() == false)
|
if (IsStartedTimer() == false)
|
||||||
{
|
{
|
||||||
// 기존에 시작하는 타이머가 없다면 타이머를 시작한다.
|
// 기존에 시작하는 타이머가 없다면 타이머를 시작한다.
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -570,7 +570,7 @@ public class TimerManager : MonoBehaviour
|
||||||
File.Delete(fileName);
|
File.Delete(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
string jsonFile = JsonConvert.SerializeObject(DateTime.Now);
|
string jsonFile = JsonConvert.SerializeObject(InternetTime.Ins.Time);
|
||||||
|
|
||||||
File.WriteAllText(fileName, jsonFile);
|
File.WriteAllText(fileName, jsonFile);
|
||||||
}
|
}
|
||||||
|
|
@ -584,7 +584,7 @@ public class TimerManager : MonoBehaviour
|
||||||
if (File.Exists(fileName) == false)
|
if (File.Exists(fileName) == false)
|
||||||
{
|
{
|
||||||
SaveTime();
|
SaveTime();
|
||||||
loadTime = DateTime.Now;
|
loadTime = InternetTime.Ins.Time;
|
||||||
|
|
||||||
return loadTime;
|
return loadTime;
|
||||||
}
|
}
|
||||||
|
|
@ -624,7 +624,7 @@ public class TimerManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (simpleTimerInfo.saveTimeData != null && simpleTimerInfo.saveTimeData.Year != 1)
|
if (simpleTimerInfo.saveTimeData != null && simpleTimerInfo.saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - simpleTimerInfo.saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - simpleTimerInfo.saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (simpleTimerInfo.limiteTimerCount - simpleTimerInfo.time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (simpleTimerInfo.limiteTimerCount - simpleTimerInfo.time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
@ -643,7 +643,7 @@ public class TimerManager : MonoBehaviour
|
||||||
|
|
||||||
if (hierarchyTimerInfo.saveTimeData != null && hierarchyTimerInfo.saveTimeData.Year != 1)
|
if (hierarchyTimerInfo.saveTimeData != null && hierarchyTimerInfo.saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - hierarchyTimerInfo.saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - hierarchyTimerInfo.saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (hierarchyTimerInfo.limiteTimerCount - hierarchyTimerInfo.time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (hierarchyTimerInfo.limiteTimerCount - hierarchyTimerInfo.time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
@ -694,7 +694,7 @@ public class TimerManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (simpleTimerInfo.saveTimeData != null && simpleTimerInfo.saveTimeData.Year != 1)
|
if (simpleTimerInfo.saveTimeData != null && simpleTimerInfo.saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - simpleTimerInfo.saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - simpleTimerInfo.saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (simpleTimerInfo.limiteTimerCount - simpleTimerInfo.time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (simpleTimerInfo.limiteTimerCount - simpleTimerInfo.time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
@ -713,7 +713,7 @@ public class TimerManager : MonoBehaviour
|
||||||
|
|
||||||
if (hierarchyTimerInfo.saveTimeData != null && hierarchyTimerInfo.saveTimeData.Year != 1)
|
if (hierarchyTimerInfo.saveTimeData != null && hierarchyTimerInfo.saveTimeData.Year != 1)
|
||||||
{
|
{
|
||||||
double passedTimeSecond = (DateTime.Now - hierarchyTimerInfo.saveTimeData).TotalSeconds;
|
double passedTimeSecond = (InternetTime.Ins.Time - hierarchyTimerInfo.saveTimeData).TotalSeconds;
|
||||||
int totalPassedTimeSecond = (hierarchyTimerInfo.limiteTimerCount - hierarchyTimerInfo.time) + (Int32)passedTimeSecond;
|
int totalPassedTimeSecond = (hierarchyTimerInfo.limiteTimerCount - hierarchyTimerInfo.time) + (Int32)passedTimeSecond;
|
||||||
|
|
||||||
if (totalPassedTimeSecond >= 0)
|
if (totalPassedTimeSecond >= 0)
|
||||||
|
|
|
||||||
|
|
@ -559,8 +559,9 @@ public class ProductSlot : CardBase
|
||||||
{
|
{
|
||||||
if (isCompleted)
|
if (isCompleted)
|
||||||
{
|
{
|
||||||
GameManager.DB.AddHeart(1, this.name);
|
GameManager.DB.AddHeart(_data.rewardAmount, this.name);
|
||||||
GameManager.DB.MinProductAdWatchedNumber(1);
|
GameManager.DB.MinProductAdWatchedNumber(1);
|
||||||
|
SetData(_data);
|
||||||
|
|
||||||
if (GameManager.DB.ProductAdWatchedNumber <= 0 && AdButton != null)
|
if (GameManager.DB.ProductAdWatchedNumber <= 0 && AdButton != null)
|
||||||
{
|
{
|
||||||
|
|
@ -569,7 +570,7 @@ public class ProductSlot : CardBase
|
||||||
AdButton.GetComponent<Image>().color = c;
|
AdButton.GetComponent<Image>().color = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameManager.DB.ProductAdWatchedNumber > 0)
|
if (GameManager.DB.ProductAdWatchedNumber == 0)
|
||||||
{
|
{
|
||||||
GameManager.Timer.ActivateSimpleTimer(name, Constants.ADS_TIMER_COUNT, OnStartTimer, OnPauseTimer, OnStopTimer, OnPassedTime);
|
GameManager.Timer.ActivateSimpleTimer(name, Constants.ADS_TIMER_COUNT, OnStartTimer, OnPauseTimer, OnStopTimer, OnPassedTime);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@ public class StorePanel : MonoBehaviour
|
||||||
list_item.Add(new ProductData("heart_cash", EProductType.Gold, "하트 10개", "다이아로 하트 구매", 300, sprites[0], EProductReward.Heart, 10));
|
list_item.Add(new ProductData("heart_cash", EProductType.Gold, "하트 10개", "다이아로 하트 구매", 300, sprites[0], EProductReward.Heart, 10));
|
||||||
list_item.Add(new ProductData("cash_heart", EProductType.Gold, "다이아 100개", "하트로 다이아 구매", 10, sprites[0], EProductReward.Key, 100));
|
list_item.Add(new ProductData("cash_heart", EProductType.Gold, "다이아 100개", "하트로 다이아 구매", 10, sprites[0], EProductReward.Key, 100));
|
||||||
|
|
||||||
list_item.Add(new ProductData("com.fgb.cash500", EProductType.IAP, "다이아 500", "", 1000, sprites[5], EProductReward.Key, 500));
|
list_item.Add(new ProductData("com.fgb.cash500", EProductType.IAP, "다이아 500", "보너스 없음", 1100, sprites[5], EProductReward.Key, 500));
|
||||||
list_item.Add(new ProductData("com.fgb.cash2000", EProductType.IAP, "다이아 2000", "", 6450, sprites[6], EProductReward.Key, 2000));
|
list_item.Add(new ProductData("com.fgb.cash1800", EProductType.IAP, "다이아 1800", "16% 보너스", 3300, sprites[6], EProductReward.Key, 1800));
|
||||||
list_item.Add(new ProductData("com.fgb.cash7500", EProductType.IAP, "다이아 7500", "", 11000, sprites[7], EProductReward.Key, 7500));
|
list_item.Add(new ProductData("com.fgb.cash7500", EProductType.IAP, "다이아 7500", "33% 보너스", 11000, sprites[7], EProductReward.Key, 7500));
|
||||||
list_item.Add(new ProductData("com.fgb.heart20", EProductType.IAP, "하트 20개", "", 1100, sprites[9], EProductReward.Heart, 20));
|
list_item.Add(new ProductData("com.fgb.heart20", EProductType.IAP, "하트 20개", "보너스 없음", 1100, sprites[9], EProductReward.Heart, 20));
|
||||||
list_item.Add(new ProductData("com.fgb.heart150", EProductType.IAP, "하트 150개", "", 7700, sprites[10], EProductReward.Heart, 150));
|
list_item.Add(new ProductData("com.fgb.heart150", EProductType.IAP, "하트 150개", "6.7% 보너스", 7700, sprites[10], EProductReward.Heart, 150));
|
||||||
list_item.Add(new ProductData("com.fgb.heart500", EProductType.IAP, "하트 500개", "", 22000, sprites[11], EProductReward.Heart, 500));
|
list_item.Add(new ProductData("com.fgb.heart500", EProductType.IAP, "하트 500개", "20% 보너스", 22000, sprites[11], EProductReward.Heart, 500));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ TextureImporter:
|
||||||
alignment: 0
|
alignment: 0
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
spritePixelsToUnits: 100
|
spritePixelsToUnits: 100
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
spriteBorder: {x: 89, y: 0, z: 88, w: 0}
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
alphaUsage: 1
|
alphaUsage: 1
|
||||||
alphaIsTransparency: 1
|
alphaIsTransparency: 1
|
||||||
|
|
@ -121,7 +121,7 @@ TextureImporter:
|
||||||
width: 177
|
width: 177
|
||||||
height: 73
|
height: 73
|
||||||
alignment: 0
|
alignment: 0
|
||||||
pivot: {x: 0, y: 0}
|
pivot: {x: 0.5, y: 0.5}
|
||||||
border: {x: 0, y: 0, z: 0, w: 0}
|
border: {x: 0, y: 0, z: 0, w: 0}
|
||||||
customData:
|
customData:
|
||||||
outline: []
|
outline: []
|
||||||
|
|
@ -139,7 +139,7 @@ TextureImporter:
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID: 5e97eb03825dee720800000000000000
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
internalID: 0
|
internalID: 1537655665
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
edges: []
|
edges: []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue