Merge branch 'hdrp' into otherstands/2024_06_piter

This commit is contained in:
a.gorbunov 2024-05-30 15:47:12 +03:00
commit b251d2f02b
6 changed files with 114 additions and 67 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Aa]rchived[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

View File

@ -13,93 +13,93 @@ MonoBehaviour:
m_Name: DefaultDailyLeaderboardPlayers
m_EditorClassIdentifier:
Players:
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 12"
- Name: "\u0414\u0430\u043D\u044C\u043A\u0430"
Score: 1013
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 56"
- Name: "\u0427\u0435\u043C\u043F\u0438\u043E\u043D"
Score: 985
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 776"
- Name: "\u0414\u0438\u043C\u0430\u0441\u0438\u043A"
Score: 966
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 45"
- Name: "\u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D \u0421\u0435\u0440\u0433\u0435\u0435\u0432\u0438\u0447"
Score: 959
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 488"
- Name: "\u041A\u0438\u0440\u0430 \u041B."
Score: 921
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 321"
- Name: "\u041B\u0443\u0447\u0448\u0435 \u043B\u0443\u0447\u0448\u0435\u0433\u043E"
Score: 899
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 512"
- Name: "\u041A\u043E\u043B\u0431\u0430\u0441\u043A\u0430"
Score: 885
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 907"
- Name: "\u041A\u0438\u0431\u043E\u0440\u0433 2000"
Score: 843
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 33"
- Name: "\u041B\u0443\u0447\u0448\u0438\u0439"
Score: 820
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 98"
- Name: "\u0412\u0412\u0412\u0430\u043D\u044C\u043A\u0430"
Score: 809
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 154"
- Name: "\u041F\u0443\u043F\u0441\u0438\u043A"
Score: 801
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 244"
- Name: "\u0417\u043B\u044E\u043A\u0430"
Score: 791
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 7"
- Name: "\u041A\u043B\u0443\u0431\u043D\u0438\u0447\u043A\u0430"
Score: 780
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 17"
- Name: "\u041A\u043E\u0442\u044D"
Score: 741
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 311"
- Name: "\u041D\u0430\u0444\u0430\u043D\u044C\u043A\u0430"
Score: 739
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 915"
- Name: "\u0426\u0432\u0435\u0442\u043E\u0447\u0435\u043A"
Score: 723
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 98"
- Name: "\u041A\u0438\u0440\u043F\u0438\u0447"
Score: 720
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 12"
- Name: "\u041B\u0443\u043D\u0442\u0438\u043A"
Score: 678
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 665"
- Name: "\u0414\u0438\u043C \u0414\u0438\u043C\u044B\u0447"
Score: 667
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 457"
- Name: "\u0421\u0443\u043F\u0435\u0440\u043C\u0435\u043D"
Score: 657
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 367"
- Name: "\u0414\u044D\u043D"
Score: 644
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 126"
- Name: "\u041F\u0430\u0442\u0440\u0438\u043A"
Score: 632
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 341"
- Name: "\u0411\u0430\u0442\u043E\u043D"
Score: 610
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 4"
- Name: "\u0417\u0435\u043B\u0435\u0431\u043E\u0431\u0430"
Score: 590
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 889"
- Name: "\u041F\u0438\u043E\u043D\u0435\u0440"
Score: 589
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 642"
- Name: "\u0411\u0430\u0440\u043E\u043D"
Score: 565
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 712"
- Name: "\u0411\u0440\u0443\u043D\u043E"
Score: 543
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 762"
- Name: "\u041A\u043E\u043B\u043B\u0438"
Score: 532
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 102"
- Name: "\u0414\u0430\u0448\u0430"
Score: 512
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 8"
- Name: "\u041A\u044D\u0442"
Score: 499
UnlockedMonumets: []

View File

@ -13,93 +13,93 @@ MonoBehaviour:
m_Name: DefaultGlobalLeaderboardPlayers
m_EditorClassIdentifier:
Players:
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 12"
- Name: "\u0414\u0430\u043D\u044C\u043A\u0430"
Score: 1013
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 56"
- Name: "\u0427\u0435\u043C\u043F\u0438\u043E\u043D"
Score: 985
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 776"
- Name: "\u0414\u0438\u043C\u0430\u0441\u0438\u043A"
Score: 966
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 45"
- Name: "\u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D \u0421\u0435\u0440\u0433\u0435\u0435\u0432\u0438\u0447"
Score: 959
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 488"
- Name: "\u041A\u0438\u0440\u0430 \u041B."
Score: 921
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 321"
- Name: "\u041B\u0443\u0447\u0448\u0435 \u043B\u0443\u0447\u0448\u0435\u0433\u043E"
Score: 899
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 512"
- Name: "\u041A\u043E\u043B\u0431\u0430\u0441\u043A\u0430"
Score: 885
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 907"
- Name: "\u041A\u0438\u0431\u043E\u0440\u0433 2000"
Score: 843
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 33"
- Name: "\u041B\u0443\u0447\u0448\u0438\u0439"
Score: 820
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 98"
- Name: "\u0412\u0412\u0412\u0430\u043D\u044C\u043A\u0430"
Score: 809
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 154"
- Name: "\u041F\u0443\u043F\u0441\u0438\u043A"
Score: 801
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 244"
- Name: "\u0417\u043B\u044E\u043A\u0430"
Score: 791
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 7"
- Name: "\u041A\u043B\u0443\u0431\u043D\u0438\u0447\u043A\u0430"
Score: 780
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 17"
- Name: "\u041A\u043E\u0442\u044D"
Score: 741
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 311"
- Name: "\u041D\u0430\u0444\u0430\u043D\u044C\u043A\u0430"
Score: 739
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 915"
- Name: "\u0426\u0432\u0435\u0442\u043E\u0447\u0435\u043A"
Score: 723
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 98"
- Name: "\u041A\u0438\u0440\u043F\u0438\u0447"
Score: 720
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 12"
- Name: "\u041B\u0443\u043D\u0442\u0438\u043A"
Score: 678
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 665"
- Name: "\u0414\u0438\u043C \u0414\u0438\u043C\u044B\u0447"
Score: 667
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 457"
- Name: "\u0421\u0443\u043F\u0435\u0440\u043C\u0435\u043D"
Score: 657
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 367"
- Name: "\u0414\u044D\u043D"
Score: 644
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 126"
- Name: "\u041F\u0430\u0442\u0440\u0438\u043A"
Score: 632
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 341"
- Name: "\u0411\u0430\u0442\u043E\u043D"
Score: 610
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 4"
- Name: "\u0417\u0435\u043B\u0435\u0431\u043E\u0431\u0430"
Score: 590
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 889"
- Name: "\u041F\u0438\u043E\u043D\u0435\u0440"
Score: 589
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 642"
- Name: "\u0411\u0430\u0440\u043E\u043D"
Score: 565
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 712"
- Name: "\u0411\u0440\u0443\u043D\u043E"
Score: 543
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 762"
- Name: "\u041A\u043E\u043B\u043B\u0438"
Score: 532
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 102"
- Name: "\u0414\u0430\u0448\u0430"
Score: 512
UnlockedMonumets: []
- Name: "\u041F\u0435\u043D\u0437\u0435\u043D\u0435\u0446 8"
- Name: "\u041A\u044D\u0442"
Score: 499
UnlockedMonumets: []

View File

@ -19,6 +19,10 @@ public class LeaderboardController : MonoBehaviour
public UnityEvent<List<Player>> OnDailyInit;
public UnityEvent<List<Player>> OnGlobalInit;
private bool _resetDaily = false;
private bool _resetGlobal = false;
private void Awake()
{
//transform.parent = null;
@ -34,12 +38,24 @@ public class LeaderboardController : MonoBehaviour
}
}
private void Start()
private IEnumerator Start()
{
//yield return new WaitForSeconds(1);
yield return new WaitForSeconds(10);
if(_resetDaily)
PlayerPrefs.SetString(DAILY_ID, string.Empty);
if(_resetGlobal)
PlayerPrefs.SetString(GLOBAL_ID, string.Empty);
InitLeaderboards();
}
private void Update()
{
if(Input.GetKeyDown(KeyCode.J))
_resetDaily = true;
if(Input.GetKeyDown(KeyCode.K))
_resetGlobal = true;
}
public void InitLeaderboards()
{
InitDailyLeaderboard();

View File

@ -38,9 +38,9 @@ public class SaveLoadController : MonoBehaviour
using (FileStream fs = File.Create(fullFilePath))
{
BinaryFormatter bf = new BinaryFormatter();
var json = JsonUtility.ToJson(so);
bf.Serialize(fs, json);
byte[] info = new System.Text.UTF8Encoding(true).GetBytes(json);
fs.Write(info, 0, info.Length);
fs.Close();
}
@ -48,7 +48,37 @@ public class SaveLoadController : MonoBehaviour
return true;
}
public bool Load<T>(ref T so, string filename) where T : ScriptableObject
public T Load<T>(ref T so, string filename) where T : ScriptableObject
{
string fullDirPath = Application.persistentDataPath + DIR_PATH;
string fullFilePath = Application.persistentDataPath + DIR_PATH + $"{filename}.txt";
Debug.Log($"LOAD:{fullFilePath}");
if (!Directory.Exists(fullDirPath))
{
Directory.CreateDirectory(fullDirPath);
}
if (File.Exists(fullFilePath))
{
using (FileStream fs = File.Open(fullFilePath, FileMode.Open))
{
using (StreamReader reader = new StreamReader(fs))
{
var file = reader.ReadToEnd();
so = ScriptableObject.CreateInstance<T>();
JsonUtility.FromJsonOverwrite(file, so);
fs.Close();
}
}
}
Debug.Log($"LOAD:SUCCESS");
return default;
}
public bool LoadOld<T>(ref T so, string filename) where T : ScriptableObject
{
string fullDirPath = Application.persistentDataPath + DIR_PATH;
string fullFilePath = Application.persistentDataPath + DIR_PATH + $"{filename}.txt";

View File

@ -266,13 +266,13 @@ PlayerSettings:
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Android: com.DefaultCompany.VRProject3
Android: com.Bogg.Art.Piter-VR
Standalone: com.Bogg.Art.Piter-VR
buildNumber:
Standalone: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 0
overrideDefaultApplicationIdentifier: 1
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 23
AndroidTargetSdkVersion: 0