Browse Source

- Дороботка прототипа

- Інструменти: Пулл партіклів, адаптери для аспектів
master
Seraph 4 years ago
parent
commit
ab8544089d
  1. 6
      Assembly-CSharp.csproj
  2. BIN
      Assets/Prototype/Core/Core.dll
  3. 59
      Assets/Prototype/Core/Core.dll.meta
  4. BIN
      Assets/Prototype/Core/CoreEditor.dll
  5. 4
      Assets/Prototype/Core/CoreEditor.dll.meta
  6. 4888
      Assets/Prototype/Custumization/Scenes/Test.unity
  7. 4
      Assets_DLL/Core/Core.csproj
  8. 2
      Assets_DLL/Core/CoreInitializer.cs
  9. 10
      Assets_DLL/Core/IAP/PurchaseManager.cs
  10. 34
      Assets_DLL/Core/Localization/LocalizationManager.cs
  11. 34
      Assets_DLL/Core/SceneManagement/SceneLoader.cs
  12. 44
      Assets_DLL/Core/Tools/AspectAdapters/CameraVerticalStretchingAdapter.cs
  13. 41
      Assets_DLL/Core/Tools/AspectAdapters/CanvasAspectAdapter.cs
  14. 42
      Assets_DLL/Core/Tools/Pool/Particles/Particle.cs
  15. 19
      Assets_DLL/Core/Tools/Pool/Particles/ParticleSpawner.cs
  16. 55
      Assets_DLL/Core/Tools/Pool/Particles/ParticlesPool.cs
  17. BIN
      Assets_DLL/Core/obj/Debug/netstandard2.0/Core.csproj.AssemblyReference.cache
  18. 2
      Assets_DLL/Core/obj/Debug/netstandard2.0/Core.csproj.CoreCompileInputs.cache
  19. BIN
      Assets_DLL/Core/obj/Debug/netstandard2.0/Core.dll
  20. 8
      Assets_DLL/CoreEditor/CoreGUILayout.cs
  21. 12
      Assets_DLL/CoreEditor/IAP/PurchaseButtonEditor.cs
  22. 8
      Assets_DLL/CoreEditor/Localization/TextLocalizatorEditor.cs
  23. 2
      Assets_DLL/CoreEditor/SceneManagement/LoadSceneButtonEditor.cs
  24. 2
      Assets_DLL/CoreEditor/Settings/CoreSettingsDataEditor.cs
  25. 23
      Assets_DLL/CoreEditor/Settings/CoreSettingsWindow.cs
  26. 36
      Assets_DLL/CoreEditor/Tools/AspectHelpers/CameraVerticalStretchingAdapterEditor.cs
  27. 27
      Assets_DLL/CoreEditor/Tools/AspectHelpers/CanvasAspectAdapterEditor.cs
  28. 2
      Assets_DLL/CoreEditor/Tools/KeystoreLoader.cs
  29. 51
      Assets_DLL/CoreEditor/Tools/Pool/Particles/ParticleSpawnerEditor.cs
  30. 64
      Assets_DLL/CoreEditor/Tools/Pool/Particles/ParticlesPoolEditor.cs
  31. 2
      Assets_DLL/CoreEditor/Tools/UnusedAssetsMarker.cs
  32. BIN
      Assets_DLL/CoreEditor/obj/Debug/netstandard2.0/CoreEditor.csproj.AssemblyReference.cache
  33. 2
      Assets_DLL/CoreEditor/obj/Debug/netstandard2.0/CoreEditor.csproj.CoreCompileInputs.cache
  34. BIN
      Assets_DLL/CoreEditor/obj/Debug/netstandard2.0/CoreEditor.dll
  35. 8
      ProjectSettings/ProjectSettings.asset

6
Assembly-CSharp.csproj

@ -248,12 +248,6 @@
<Reference Include="UnityEditor"> <Reference Include="UnityEditor">
<HintPath>C:\Program Files\Unity\Hub\Editor\2019.4.28f1\Editor\Data\Managed\UnityEditor.dll</HintPath> <HintPath>C:\Program Files\Unity\Hub\Editor\2019.4.28f1\Editor\Data\Managed\UnityEditor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Core">
<HintPath>Assets\Prototype\Core\Core.dll</HintPath>
</Reference>
<Reference Include="CoreEditor">
<HintPath>Assets\Prototype\Core\CoreEditor.dll</HintPath>
</Reference>
<Reference Include="DOTween"> <Reference Include="DOTween">
<HintPath>Assets\Prototype\DOTween\DOTween.dll</HintPath> <HintPath>Assets\Prototype\DOTween\DOTween.dll</HintPath>
</Reference> </Reference>

BIN
Assets/Prototype/Core/Core.dll

Binary file not shown.

59
Assets/Prototype/Core/Core.dll.meta

@ -8,9 +8,27 @@ PluginImporter:
defineConstraints: [] defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0 isExplicitlyReferenced: 1
validateReferences: 1 validateReferences: 0
platformData: platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first: - first:
Any: Any:
second: second:
@ -19,15 +37,50 @@ PluginImporter:
- first: - first:
Editor: Editor Editor: Editor
second: second:
enabled: 0 enabled: 1
settings: settings:
CPU: AnyCPU
DefaultValueInitialized: true DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
- first: - first:
Windows Store Apps: WindowsStoreApps Windows Store Apps: WindowsStoreApps
second: second:
enabled: 0 enabled: 0
settings: settings:
CPU: AnyCPU CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CPU: AnyCPU
CompileFlags:
FrameworkDependencies:
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

BIN
Assets/Prototype/Core/CoreEditor.dll

Binary file not shown.

4
Assets/Prototype/Core/CoreEditor.dll.meta

@ -8,8 +8,8 @@ PluginImporter:
defineConstraints: [] defineConstraints: []
isPreloaded: 0 isPreloaded: 0
isOverridable: 0 isOverridable: 0
isExplicitlyReferenced: 0 isExplicitlyReferenced: 1
validateReferences: 1 validateReferences: 0
platformData: platformData:
- first: - first:
: Any : Any

4888
Assets/Prototype/Custumization/Scenes/Test.unity

File diff suppressed because it is too large

4
Assets_DLL/Core/Core.csproj

@ -215,4 +215,8 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Tools\UI\" />
</ItemGroup>
</Project> </Project>

2
Assets_DLL/Core/CoreInitializer.cs

@ -9,7 +9,7 @@ namespace Core
{ {
internal sealed class CoreInitializer internal sealed class CoreInitializer
{ {
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
private static void Init() private static void Init()
{ {
PurchaseManager.Init(); PurchaseManager.Init();

10
Assets_DLL/Core/IAP/PurchaseManager.cs

@ -6,7 +6,7 @@ namespace Core.IAP
{ {
public sealed class PurchaseManager : MonoBehaviour public sealed class PurchaseManager : MonoBehaviour
{ {
private static PurchaseManager _instance = null; private static PurchaseManager _current = null;
private static PurchaseManagerBase _purchaseManager = null; private static PurchaseManagerBase _purchaseManager = null;
public static event Action<string> OnPurchaseSuccess = null; public static event Action<string> OnPurchaseSuccess = null;
@ -14,10 +14,10 @@ namespace Core.IAP
internal static void Init() internal static void Init()
{ {
GameObject gameObject = new GameObject("[SceneLoader]"); GameObject gameObject = new GameObject("[PurchaseManager]");
_instance = gameObject.AddComponent<PurchaseManager>(); _current = gameObject.AddComponent<PurchaseManager>();
DontDestroyOnLoad(_instance); DontDestroyOnLoad(_current);
_purchaseManager = new PurchaseManagerBase(); _purchaseManager = new PurchaseManagerBase();
_purchaseManager.InitializePurchasing(); _purchaseManager.InitializePurchasing();
@ -35,7 +35,7 @@ namespace Core.IAP
public static void Buy(string productId) public static void Buy(string productId)
{ {
if (Application.isEditor) if (Application.isEditor)
_instance.TryPurchaseInEditor(productId); _current.TryPurchaseInEditor(productId);
else else
_purchaseManager.BuyProduct(productId); _purchaseManager.BuyProduct(productId);
} }

34
Assets_DLL/Core/Localization/LocalizationManager.cs

@ -34,20 +34,42 @@ namespace Core.Localization
if (CoreSettings.data.localizationTable != null) if (CoreSettings.data.localizationTable != null)
{ {
if (_table == null) _table = new CSVDataTable();
{ _table.ReadFromTextAsset(CoreSettings.data.localizationTable);
_table = new CSVDataTable();
_table.ReadFromTextAsset(CoreSettings.data.localizationTable);
}
for (int i = 0; i < _table.RowCount; i++) for (int i = 0; i < _table.RowCount; i++)
{ {
List<string> senteces = _table.GetRow(i); List<string> senteces = _table.GetRow(i);
keys.Add(senteces[0]); keys.Add(senteces[0]);
} }
return keys;
} }
else
throw new ArgumentNullException("CSV is null");
}
}
return keys; public static IReadOnlyList<SystemLanguage> Languages
{
get
{
List<SystemLanguage> languages = new List<SystemLanguage>();
if (CoreSettings.data.localizationTable != null)
{
_table = new CSVDataTable();
_table.ReadFromTextAsset(CoreSettings.data.localizationTable);
IReadOnlyList<string> languagesString = _table.Header;
for (int i = 1; i < languagesString.Count; i++)
languages.Add((SystemLanguage)Enum.Parse(typeof(SystemLanguage), languagesString[i]));
return languages;
}
else
throw new ArgumentNullException("CSV is null");
} }
} }

34
Assets_DLL/Core/SceneManagement/SceneLoader.cs

@ -10,7 +10,7 @@ namespace Core.SceneManagement
{ {
public sealed class SceneLoader : MonoBehaviour public sealed class SceneLoader : MonoBehaviour
{ {
private static SceneLoader _instance = null; private static SceneLoader _current = null;
public static event Action<string> OnLoadedStart; public static event Action<string> OnLoadedStart;
public static event Action<string, string> OnLoadedComplete; public static event Action<string, string> OnLoadedComplete;
@ -26,18 +26,28 @@ namespace Core.SceneManagement
internal static void Init() internal static void Init()
{ {
GameObject gameObject = new GameObject("[SceneLoader]"); GameObject gameObject = new GameObject("[SceneLoader]");
_instance = gameObject.AddComponent<SceneLoader>(); _current = gameObject.AddComponent<SceneLoader>();
DontDestroyOnLoad(_instance); DontDestroyOnLoad(_current);
if (SceneManager.GetActiveScene().name == "Init") _currentScene = SceneManager.GetActiveScene().name;
if (_currentScene == "Init")
{ {
_currentLoadingScreen = Instantiate(CoreSettings.data.mainLoadingScreen, _instance.transform); _currentLoadingScreen = Instantiate(CoreSettings.data.mainLoadingScreen, _current.transform);
_currentLoadingScreen.Fade.alpha = 0f; _currentLoadingScreen.Fade.alpha = 0f;
_currentLoadingScreen.MainPanel.SetActive(false); _currentLoadingScreen.MainPanel.SetActive(false);
LoadScene(CoreSettings.data.firstScene); LoadScene(CoreSettings.data.firstScene);
} }
else
{
if (CoreSettings.data.needBanner)
{
if (CoreSettings.data.bannerSettings.Where(s => s.scene == CurrentScene).Count() > 0)
AdsManager.ShowBanner(CoreSettings.data.bannerSettings.Where(s => s.scene == CurrentScene).FirstOrDefault().positions);
}
}
} }
public static void LoadScene(string scene) public static void LoadScene(string scene)
@ -47,7 +57,7 @@ namespace Core.SceneManagement
OnLoadedStart?.Invoke(scene); OnLoadedStart?.Invoke(scene);
_instance.StartCoroutine(StartLoad(scene)); _current.StartCoroutine(StartLoad(scene));
} }
private static IEnumerator StartLoad(string scene) private static IEnumerator StartLoad(string scene)
@ -60,15 +70,15 @@ namespace Core.SceneManagement
if (_currentLoadingScreen == null) if (_currentLoadingScreen == null)
{ {
if (CoreSettings.data.loadingScreenForRandom.Count != 0) if (CoreSettings.data.loadingScreenForRandom.Count != 0)
_currentLoadingScreen = Instantiate(CoreSettings.data.loadingScreenForRandom[UnityEngine.Random.Range(0, CoreSettings.data.loadingScreenForRandom.Count)], _instance.transform); _currentLoadingScreen = Instantiate(CoreSettings.data.loadingScreenForRandom[UnityEngine.Random.Range(0, CoreSettings.data.loadingScreenForRandom.Count)], _current.transform);
else else
_currentLoadingScreen = Instantiate(CoreSettings.data.mainLoadingScreen, _instance.transform); _currentLoadingScreen = Instantiate(CoreSettings.data.mainLoadingScreen, _current.transform);
_currentLoadingScreen.Fade.alpha = 0f; _currentLoadingScreen.Fade.alpha = 0f;
_currentLoadingScreen.MainPanel.SetActive(false); _currentLoadingScreen.MainPanel.SetActive(false);
} }
yield return _instance.StartCoroutine(FadeLoadingScreen(1, CoreSettings.data.fadeDuration)); yield return _current.StartCoroutine(FadeLoadingScreen(1, CoreSettings.data.fadeDuration));
string fromScene = _currentScene; string fromScene = _currentScene;
@ -87,7 +97,7 @@ namespace Core.SceneManagement
_currentLoadingScreen.MainPanel.SetActive(true); _currentLoadingScreen.MainPanel.SetActive(true);
yield return _instance.StartCoroutine(FadeLoadingScreen(0, CoreSettings.data.fadeDuration)); yield return _current.StartCoroutine(FadeLoadingScreen(0, CoreSettings.data.fadeDuration));
OnFadeScreenVisibleChanged?.Invoke(true); OnFadeScreenVisibleChanged?.Invoke(true);
@ -106,11 +116,11 @@ namespace Core.SceneManagement
yield return null; yield return null;
} }
yield return _instance.StartCoroutine(FadeLoadingScreen(1, CoreSettings.data.fadeDuration)); yield return _current.StartCoroutine(FadeLoadingScreen(1, CoreSettings.data.fadeDuration));
_currentLoadingScreen.MainPanel.SetActive(false); _currentLoadingScreen.MainPanel.SetActive(false);
yield return _instance.StartCoroutine(FadeLoadingScreen(0, CoreSettings.data.fadeDuration)); yield return _current.StartCoroutine(FadeLoadingScreen(0, CoreSettings.data.fadeDuration));
OnFadeScreenVisibleChanged?.Invoke(false); OnFadeScreenVisibleChanged?.Invoke(false);

44
Assets_DLL/Core/Tools/AspectAdapters/CameraVerticalStretchingAdapter.cs

@ -0,0 +1,44 @@
using UnityEngine;
namespace Core.Tools.AspectAdapters
{
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class CameraVerticalStretchingAdapter : MonoBehaviour
{
[SerializeField] private float _standartCameraSize = 11.75f;
[SerializeField] private float _standartCameraAngle = 60f;
[SerializeField] private Camera _camera = null;
private void Reset() =>
_camera = GetComponent<Camera>();
private void Awake() =>
SetCameraSize();
private void Update()
{
if (Application.isEditor)
SetCameraSize();
}
private void SetCameraSize()
{
if (_camera.orthographic)
{
float newSize = _standartCameraSize / _camera.aspect;
if (_camera.orthographicSize != newSize)
_camera.orthographicSize = newSize;
}
else
{
float newAngle = _standartCameraAngle / _camera.aspect;
if (_camera.fieldOfView != newAngle)
_camera.fieldOfView = newAngle;
}
}
}
}

41
Assets_DLL/Core/Tools/AspectAdapters/CanvasAspectAdapter.cs

@ -0,0 +1,41 @@
using UnityEngine;
using UnityEngine.UI;
using System;
namespace Core.Tools.AspectAdapters
{
[ExecuteInEditMode]
[RequireComponent(typeof(CanvasScaler))]
public sealed class CanvasAspectAdapter : MonoBehaviour
{
[SerializeField] private CanvasScaler _canvasScaler = null;
private void Reset() =>
_canvasScaler = GetComponent<CanvasScaler>();
private void Awake()
{
_canvasScaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
_canvasScaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight;
SetCanvasAspect();
}
private void Update()
{
if (Application.isEditor)
SetCanvasAspect();
}
private void SetCanvasAspect()
{
if (Camera.main == null)
throw new ArgumentNullException("MainCamera not found");
if (Camera.main.aspect < (_canvasScaler.referenceResolution.x / _canvasScaler.referenceResolution.y))
_canvasScaler.matchWidthOrHeight = 0f;
else
_canvasScaler.matchWidthOrHeight = 1f;
}
}
}

42
Assets_DLL/Core/Tools/Pool/Particles/Particle.cs

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Core.Tools.Pool.Particles
{
[Serializable]
public sealed class Particle
{
[SerializeField] private string _id = "particle";
[SerializeField] private ParticleSystem _prefab = null;
[SerializeField] private int _startCount = 1;
private List<ParticleSystem> _pool = new List<ParticleSystem>();
private Transform _summonParent = null;
public string ID => _id;
public void Init(Transform summonParent)
{
_summonParent = summonParent;
for (int i = 0; i < _startCount; i++)
_pool.Add(GameObject.Instantiate(_prefab, _summonParent));
}
public ParticleSystem GetParticleFromPool()
{
ParticleSystem particle = _pool.Where(p => p != null && !p.isPlaying).FirstOrDefault();
if (particle == null)
{
particle = GameObject.Instantiate(_prefab, _summonParent);
_pool.Add(particle);
}
return particle;
}
}
}

19
Assets_DLL/Core/Tools/Pool/Particles/ParticleSpawner.cs

@ -0,0 +1,19 @@
using UnityEngine;
namespace Core.Tools.Pool.Particles
{
public sealed class ParticleSpawner : MonoBehaviour
{
[SerializeField] private string _particleName = "";
[SerializeField] private bool _spawnOnAwake = true;
private void Start()
{
if (_spawnOnAwake)
Spawn();
}
public void Spawn() =>
ParticlesPool.PlayParticle(_particleName, transform.position, transform.rotation, Vector3.one, transform);
}
}

55
Assets_DLL/Core/Tools/Pool/Particles/ParticlesPool.cs

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Core.Tools.Pool.Particles
{
[ExecuteInEditMode]
public sealed class ParticlesPool : MonoBehaviour
{
private static ParticlesPool _current = null;
public static string[] GetParticlesName()
{
if (_current == null)
return new string[0];
return _current._particles.Select(p => p.ID).ToArray();
}
public static void PlayParticle(string id, Vector3 position, Quaternion rotation, Vector3 scale, Transform parent)
{
if (_current == null)
throw new ArgumentNullException("ParticlesPool not found on scene");
Particle particle = _current._particles.Where(p => p.ID == id).FirstOrDefault();
if (particle == null)
throw new KeyNotFoundException($"particle with id={id} not found!!!");
ParticleSystem particleSystem = particle.GetParticleFromPool();
particleSystem.transform.SetParent(parent);
particleSystem.transform.position = position;
particleSystem.transform.rotation = rotation;
particleSystem.transform.localScale = scale;
particleSystem.Play();
}
[SerializeField] private Particle[] _particles = new Particle[0];
private void OnEnable() =>
_current = this;
private void Awake()
{
if (!Application.isPlaying)
return;
for (int i = 0; i < _particles.Length; i++)
_particles[i].Init(transform);
}
}
}

BIN
Assets_DLL/Core/obj/Debug/netstandard2.0/Core.csproj.AssemblyReference.cache

Binary file not shown.

2
Assets_DLL/Core/obj/Debug/netstandard2.0/Core.csproj.CoreCompileInputs.cache

@ -1 +1 @@
0ba7e6792316ae7e255beef2c30122219f6f0082 d1c5eb68f3ce5b18f962b2e20f3968ce352e152d

BIN
Assets_DLL/Core/obj/Debug/netstandard2.0/Core.dll

Binary file not shown.

8
Assets_DLL/CoreEditor/CoreGUILayout.cs

@ -19,12 +19,18 @@ namespace CoreEditor
int currentIndex = scenes.IndexOf(sceneName); int currentIndex = scenes.IndexOf(sceneName);
if (currentIndex < 0) if (currentIndex < 0 && !string.IsNullOrWhiteSpace(sceneName))
{ {
scenes.Insert(0, sceneName); scenes.Insert(0, sceneName);
currentIndex = 0; currentIndex = 0;
} }
if (scenes.Count == 0)
{
currentIndex = 0;
scenes = new List<string> { "None" };
}
currentIndex = EditorGUILayout.Popup(text, currentIndex, scenes.ToArray()); currentIndex = EditorGUILayout.Popup(text, currentIndex, scenes.ToArray());
return scenes[currentIndex]; return scenes[currentIndex];

12
Assets_DLL/CoreEditor/IAP/PurchaseButtonEditor.cs

@ -6,7 +6,7 @@ using UnityEditor;
namespace CoreEditor.Localization namespace CoreEditor.Localization
{ {
[CustomEditor(typeof(PurchaseButton))] [CustomEditor(typeof(PurchaseButton))]
public sealed class PurchaseButtonEditor : Editor internal sealed class PurchaseButtonEditor : Editor
{ {
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {
@ -23,11 +23,17 @@ namespace CoreEditor.Localization
int currentIndex = products.IndexOf(productId.stringValue); int currentIndex = products.IndexOf(productId.stringValue);
if (currentIndex < 0 || currentIndex >= products.Count) if (currentIndex < 0 && !string.IsNullOrWhiteSpace(productId.stringValue))
{
products.Insert(0, productId.stringValue);
currentIndex = 0; currentIndex = 0;
}
if (products.Count == 0) if (products.Count == 0)
{
currentIndex = 0;
products = new List<string> { "None" }; products = new List<string> { "None" };
}
currentIndex = EditorGUILayout.Popup("Product ID:", currentIndex, products.ToArray()); currentIndex = EditorGUILayout.Popup("Product ID:", currentIndex, products.ToArray());
@ -41,6 +47,8 @@ namespace CoreEditor.Localization
EditorGUILayout.PropertyField(serializedObject.FindProperty("_onFailed")); EditorGUILayout.PropertyField(serializedObject.FindProperty("_onFailed"));
EditorGUILayout.Space(5);
serializedObject.ApplyModifiedProperties(); serializedObject.ApplyModifiedProperties();
} }
} }

8
Assets_DLL/CoreEditor/Localization/TextLocalizatorEditor.cs

@ -20,11 +20,17 @@ namespace CoreEditor.Localization
int currentIndex = keys.IndexOf(key.stringValue); int currentIndex = keys.IndexOf(key.stringValue);
if (currentIndex < 0 || currentIndex >= keys.Count) if (currentIndex < 0 && !string.IsNullOrWhiteSpace(key.stringValue))
{
keys.Insert(0, key.stringValue);
currentIndex = 0; currentIndex = 0;
}
if (keys.Count == 0) if (keys.Count == 0)
{
currentIndex = 0;
keys = new List<string> { "None" }; keys = new List<string> { "None" };
}
currentIndex = EditorGUILayout.Popup("Key:", currentIndex, keys.ToArray()); currentIndex = EditorGUILayout.Popup("Key:", currentIndex, keys.ToArray());

2
Assets_DLL/CoreEditor/SceneManagement/LoadSceneButtonEditor.cs

@ -6,7 +6,7 @@ using UnityEditor;
namespace CoreEditor.SceneManagement namespace CoreEditor.SceneManagement
{ {
[CustomEditor(typeof(LoadSceneButton))] [CustomEditor(typeof(LoadSceneButton))]
public sealed class LoadSceneButtonEditor : Editor internal sealed class LoadSceneButtonEditor : Editor
{ {
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {

2
Assets_DLL/CoreEditor/Settings/CoreSettingsDataEditor.cs

@ -5,7 +5,7 @@ using UnityEngine;
namespace CoreEditor.Settings namespace CoreEditor.Settings
{ {
[CustomEditor(typeof(CoreSettingsData))] [CustomEditor(typeof(CoreSettingsData))]
public sealed class CoreSettingsDataEditor : Editor internal sealed class CoreSettingsDataEditor : Editor
{ {
public override void OnInspectorGUI() public override void OnInspectorGUI()
{ {

23
Assets_DLL/CoreEditor/Settings/CoreSettingsWindow.cs

@ -5,10 +5,12 @@ using System.IO;
using Core.Settings; using Core.Settings;
using Core.SceneManagement; using Core.SceneManagement;
using Core.Ads; using Core.Ads;
using System.Collections.Generic;
using Core.Localization;
namespace CoreEditor.Settings namespace CoreEditor.Settings
{ {
public sealed class CoreSettingsWindow : EditorWindow internal sealed class CoreSettingsWindow : EditorWindow
{ {
private static CoreSettingsData _coreSettings; private static CoreSettingsData _coreSettings;
@ -396,6 +398,25 @@ namespace CoreEditor.Settings
if (_propertiesList[5] == true) if (_propertiesList[5] == true)
{ {
GUILayout.Space(3);
if (GUILayout.Button("Load available languages from CSV"))
{
if (_coreSettings.localizationTable != null)
{
IReadOnlyList<SystemLanguage> languageInCSV = LocalizationManager.Languages;
_coreSettings.availableLanguages = new List<SystemLanguage>();
foreach (SystemLanguage language in languageInCSV)
_coreSettings.availableLanguages.Add(language);
}
else
throw new ArgumentNullException("CSV is null");
}
GUILayout.Space(5);
EditorGUILayout.BeginVertical("BOX"); EditorGUILayout.BeginVertical("BOX");
GUILayout.Space(5); GUILayout.Space(5);

36
Assets_DLL/CoreEditor/Tools/AspectHelpers/CameraVerticalStretchingAdapterEditor.cs

@ -0,0 +1,36 @@
using Core.Tools.AspectAdapters;
using UnityEditor;
using UnityEngine;
namespace CoreEditor.Tools.AspectAdapters
{
[CustomEditor(typeof(CameraVerticalStretchingAdapter))]
internal sealed class CameraVerticalStretchingAdapterEditor : Editor
{
public override void OnInspectorGUI()
{
CameraVerticalStretchingAdapter script = (CameraVerticalStretchingAdapter)target;
Camera camera = (Camera)serializedObject.FindProperty("_camera").objectReferenceValue;
serializedObject.Update();
EditorGUILayout.Space(5);
if (camera.orthographic)
{
GUILayout.Label("Camera size for screen 1x1", EditorStyles.helpBox);
EditorGUILayout.PropertyField(serializedObject.FindProperty("_standartCameraSize"));
}
else
{
GUILayout.Label("Camera angle for screen 1x1", EditorStyles.helpBox);
EditorGUILayout.PropertyField(serializedObject.FindProperty("_standartCameraAngle"));
}
EditorGUILayout.Space(5);
serializedObject.ApplyModifiedProperties();
}
}
}

27
Assets_DLL/CoreEditor/Tools/AspectHelpers/CanvasAspectAdapterEditor.cs

@ -0,0 +1,27 @@
using Core.Tools.AspectAdapters;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
namespace CoreEditor.Tools.AspectAdapters
{
[CustomEditor(typeof(CanvasAspectAdapter))]
internal sealed class CanvasAspectAdapterEditor : Editor
{
public override void OnInspectorGUI()
{
CanvasAspectAdapter script = (CanvasAspectAdapter)target;
CanvasScaler canvasScaler = (CanvasScaler)serializedObject.FindProperty("_canvasScaler").objectReferenceValue;
canvasScaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
canvasScaler.screenMatchMode = CanvasScaler.ScreenMatchMode.MatchWidthOrHeight;
EditorGUILayout.Space(5);
GUILayout.Label("Made UI for 16:9 screen", EditorStyles.helpBox);
EditorGUILayout.Space(5);
}
}
}

2
Assets_DLL/CoreEditor/Tools/KeystoreLoader.cs

@ -5,7 +5,7 @@ using UnityEngine;
namespace Core.Tools namespace Core.Tools
{ {
[InitializeOnLoad] [InitializeOnLoad]
public sealed class KeystoreLoader internal sealed class KeystoreLoader
{ {
static KeystoreLoader() static KeystoreLoader()
{ {

51
Assets_DLL/CoreEditor/Tools/Pool/Particles/ParticleSpawnerEditor.cs

@ -0,0 +1,51 @@
using Core.Localization;
using Core.Tools.Pool.Particles;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
namespace CoreEditor.Localization
{
[CustomEditor(typeof(ParticleSpawner))]
public class ParticleSpawnerEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.Space(5);
SerializedProperty particleName = serializedObject.FindProperty("_particleName");
List<string> particles = ParticlesPool.GetParticlesName().ToList();
int currentIndex = particles.IndexOf(particleName.stringValue);
if (currentIndex < 0 && !string.IsNullOrWhiteSpace(particleName.stringValue))
{
particles.Insert(0, particleName.stringValue);
currentIndex = 0;
}
if (particles.Count == 0)
{
currentIndex = 0;
particles = new List<string> { "None" };
}
currentIndex = EditorGUILayout.Popup("ParticleID:", currentIndex, particles.ToArray());
particleName.stringValue = particles[currentIndex];
EditorGUILayout.Space(5);
SerializedProperty spawnOnAwake = serializedObject.FindProperty("_spawnOnAwake");
spawnOnAwake.boolValue = EditorGUILayout.Toggle("Spawn on Awake", spawnOnAwake.boolValue);
EditorGUILayout.Space(5);
serializedObject.ApplyModifiedProperties();
}
}
}

64
Assets_DLL/CoreEditor/Tools/Pool/Particles/ParticlesPoolEditor.cs

@ -0,0 +1,64 @@
using Core.Tools.Pool.Particles;
using UnityEditor;
using UnityEngine;
namespace CoreEditor.Localization
{
[CustomEditor(typeof(ParticlesPool))]
public class ParticlesPoolEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
SerializedProperty particles = serializedObject.FindProperty("_particles");
EditorGUILayout.Space(5);
EditorGUILayout.BeginHorizontal("BOX");
GUILayout.Label("ID", EditorStyles.label);
GUILayout.Label(" Prefab", EditorStyles.label);
GUILayout.Label("StartCount", EditorStyles.label, GUILayout.MaxWidth(64));
GUILayout.Label("", EditorStyles.label, GUILayout.MaxWidth(64));
EditorGUILayout.EndHorizontal();
EditorGUILayout.Space(5);
for (int i = 0; i < particles.arraySize; i++)
{
EditorGUILayout.BeginHorizontal("BOX");
SerializedProperty particle = particles.GetArrayElementAtIndex(i);
SerializedProperty id = particle.FindPropertyRelative("_id");
SerializedProperty prefab = particle.FindPropertyRelative("_prefab");
SerializedProperty count = particle.FindPropertyRelative("_startCount");
id.stringValue = EditorGUILayout.TextField(id.stringValue);
EditorGUILayout.PropertyField(prefab, GUIContent.none);
count.intValue = EditorGUILayout.IntField(count.intValue, GUILayout.MaxWidth(64));
if (GUILayout.Button("Remove", GUILayout.MaxWidth(64)))
particles.DeleteArrayElementAtIndex(i);
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.Space(5);
if (GUILayout.Button("Add"))
{
particles.InsertArrayElementAtIndex(particles.arraySize);
}
EditorGUILayout.Space(5);
serializedObject.ApplyModifiedProperties();
}
}
}

2
Assets_DLL/CoreEditor/Tools/UnusedAssetsMarker.cs

@ -8,7 +8,7 @@ using UnityEngine;
namespace Core.Tools namespace Core.Tools
{ {
[InitializeOnLoad] [InitializeOnLoad]
public static class UnusedAssetsMarker internal static class UnusedAssetsMarker
{ {
private struct FolderInfo private struct FolderInfo
{ {

BIN
Assets_DLL/CoreEditor/obj/Debug/netstandard2.0/CoreEditor.csproj.AssemblyReference.cache

Binary file not shown.

2
Assets_DLL/CoreEditor/obj/Debug/netstandard2.0/CoreEditor.csproj.CoreCompileInputs.cache

@ -1 +1 @@
11bcacb5e6198468d31724d89237cbc3f0ee9953 303f7c18877e6d0c94d1ea8312a22f962649285d

BIN
Assets_DLL/CoreEditor/obj/Debug/netstandard2.0/CoreEditor.dll

Binary file not shown.

8
ProjectSettings/ProjectSettings.asset

@ -12,8 +12,8 @@ PlayerSettings:
targetDevice: 2 targetDevice: 2
useOnDemandResources: 0 useOnDemandResources: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: DefaultCompany companyName: SeraphStudio
productName: Core productName: Prototype
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
@ -54,8 +54,8 @@ PlayerSettings:
androidShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1
iosUseCustomAppBackgroundBehavior: 0 iosUseCustomAppBackgroundBehavior: 0
iosAllowHTTPDownload: 1 iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1 allowedAutorotateToPortrait: 0
allowedAutorotateToPortraitUpsideDown: 1 allowedAutorotateToPortraitUpsideDown: 0
allowedAutorotateToLandscapeRight: 1 allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1 allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1 useOSAutorotation: 1

Loading…
Cancel
Save