Commit 879061cf authored by Vi Vũ's avatar Vi Vũ

Vi commit iOS

parent e4551c32
fileFormatVersion: 2
guid: 0545315f4e3d2ca4e8dee1c7743990bc
guid: fa312c4195da8472684676f92e04e69f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
......
fileFormatVersion: 2
guid: c5c36414e8273294aae9dae26893b8a3
guid: b45c7b45c9256a745978ed0eb3cf5663
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
......
fileFormatVersion: 2
guid: d2e45ca1b6714194e90f7eb923c3f243
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System;
namespace Crystal
{
public class SafeAreaDemo : MonoBehaviour
{
[SerializeField] KeyCode KeySafeArea = KeyCode.A;
SafeArea.SimDevice[] Sims;
int SimIdx;
void Awake ()
{
if (!Application.isEditor)
Destroy (this);
Sims = (SafeArea.SimDevice[])Enum.GetValues (typeof (SafeArea.SimDevice));
}
void Update ()
{
if (Input.GetKeyDown (KeySafeArea))
ToggleSafeArea ();
}
/// <summary>
/// Toggle the safe area simulation device.
/// </summary>
void ToggleSafeArea ()
{
SimIdx++;
if (SimIdx >= Sims.Length)
SimIdx = 0;
SafeArea.Sim = Sims[SimIdx];
Debug.LogFormat ("Switched to sim device {0} with debug key '{1}'", Sims[SimIdx], KeySafeArea);
}
}
}
fileFormatVersion: 2
guid: 9dd219ac2bff62648a6ae1c651c2eb5b
timeCreated: 1475885146
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
===============================
Safe Area Helper
===============================
Usage:
1. Create desired aspect ratios in the Game Window, e.g. 195:90 and 90:195 for iPhone X series.
2. Add the SafeArea.cs component to your GUI panels.
3. Add the SafeAreaDemo.cs once to a component in your scene.
4. Run the game and use the Toggle hotkey (default "A") to toggle between simulated devices.
Be sure to match the simulated device with the correct aspect ratio in your Game Window.
Add your own simulated devices:
1. Run an empty scene to the target mobile device with one GUI panel containing the SafeArea.cs component.
2. Rotate the device to each of the four orientations. Copy the pixel coordinates for each orientation from the debug output.
3. Enter the simulated device into SafeArea.cs using the same technique for the iPhone X.
See notes in SafeArea.cs and read our article online for a full breakdown of how the Safe Area works.
If you have a suggestion or request for a simluated device to be added to the list, please let us know in the Unity forums.
If this asset helped you, please rate us on the Asset Store!
fileFormatVersion: 2
guid: 1c5d0ac416e6c7847bc6fc71a0c41f8b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 5846b5bb2b526d74c83c795f9ab0487c
guid: a6e5e67a77ff0402b907d9f025feb0f8
DefaultImporter:
externalObjects: {}
userData:
......
using UnityEngine;
namespace Crystal
{
/// <summary>
/// Safe area implementation for notched mobile devices. Usage:
/// (1) Add this component to the top level of any GUI panel.
/// (2) If the panel uses a full screen background image, then create an immediate child and put the component on that instead, with all other elements childed below it.
/// This will allow the background image to stretch to the full extents of the screen behind the notch, which looks nicer.
/// (3) For other cases that use a mixture of full horizontal and vertical background stripes, use the Conform X & Y controls on separate elements as needed.
/// </summary>
public class SafeArea : MonoBehaviour
{
#region Simulations
/// <summary>
/// Simulation device that uses safe area due to a physical notch or software home bar. For use in Editor only.
/// </summary>
public enum SimDevice
{
/// <summary>
/// Don't use a simulated safe area - GUI will be full screen as normal.
/// </summary>
None,
/// <summary>
/// Simulate the iPhone X and Xs (identical safe areas).
/// </summary>
iPhoneX,
/// <summary>
/// Simulate the iPhone Xs Max and XR (identical safe areas).
/// </summary>
iPhoneXsMax,
/// <summary>
/// Simulate the Google Pixel 3 XL using landscape left.
/// </summary>
Pixel3XL_LSL,
/// <summary>
/// Simulate the Google Pixel 3 XL using landscape right.
/// </summary>
Pixel3XL_LSR
}
/// <summary>
/// Simulation mode for use in editor only. This can be edited at runtime to toggle between different safe areas.
/// </summary>
public static SimDevice Sim = SimDevice.None;
/// <summary>
/// Normalised safe areas for iPhone X with Home indicator (ratios are identical to Xs, 11 Pro). Absolute values:
/// PortraitU x=0, y=102, w=1125, h=2202 on full extents w=1125, h=2436;
/// PortraitD x=0, y=102, w=1125, h=2202 on full extents w=1125, h=2436 (not supported, remains in Portrait Up);
/// LandscapeL x=132, y=63, w=2172, h=1062 on full extents w=2436, h=1125;
/// LandscapeR x=132, y=63, w=2172, h=1062 on full extents w=2436, h=1125.
/// Aspect Ratio: ~19.5:9.
/// </summary>
Rect[] NSA_iPhoneX = new Rect[]
{
new Rect (0f, 102f / 2436f, 1f, 2202f / 2436f), // Portrait
new Rect (132f / 2436f, 63f / 1125f, 2172f / 2436f, 1062f / 1125f) // Landscape
};
/// <summary>
/// Normalised safe areas for iPhone Xs Max with Home indicator (ratios are identical to XR, 11, 11 Pro Max). Absolute values:
/// PortraitU x=0, y=102, w=1242, h=2454 on full extents w=1242, h=2688;
/// PortraitD x=0, y=102, w=1242, h=2454 on full extents w=1242, h=2688 (not supported, remains in Portrait Up);
/// LandscapeL x=132, y=63, w=2424, h=1179 on full extents w=2688, h=1242;
/// LandscapeR x=132, y=63, w=2424, h=1179 on full extents w=2688, h=1242.
/// Aspect Ratio: ~19.5:9.
/// </summary>
Rect[] NSA_iPhoneXsMax = new Rect[]
{
new Rect (0f, 102f / 2688f, 1f, 2454f / 2688f), // Portrait
new Rect (132f / 2688f, 63f / 1242f, 2424f / 2688f, 1179f / 1242f) // Landscape
};
/// <summary>
/// Normalised safe areas for Pixel 3 XL using landscape left. Absolute values:
/// PortraitU x=0, y=0, w=1440, h=2789 on full extents w=1440, h=2960;
/// PortraitD x=0, y=0, w=1440, h=2789 on full extents w=1440, h=2960;
/// LandscapeL x=171, y=0, w=2789, h=1440 on full extents w=2960, h=1440;
/// LandscapeR x=0, y=0, w=2789, h=1440 on full extents w=2960, h=1440.
/// Aspect Ratio: 18.5:9.
/// </summary>
Rect[] NSA_Pixel3XL_LSL = new Rect[]
{
new Rect (0f, 0f, 1f, 2789f / 2960f), // Portrait
new Rect (0f, 0f, 2789f / 2960f, 1f) // Landscape
};
/// <summary>
/// Normalised safe areas for Pixel 3 XL using landscape right. Absolute values and aspect ratio same as above.
/// </summary>
Rect[] NSA_Pixel3XL_LSR = new Rect[]
{
new Rect (0f, 0f, 1f, 2789f / 2960f), // Portrait
new Rect (171f / 2960f, 0f, 2789f / 2960f, 1f) // Landscape
};
#endregion
RectTransform Panel;
Rect LastSafeArea = new Rect (0, 0, 0, 0);
Vector2Int LastScreenSize = new Vector2Int (0, 0);
ScreenOrientation LastOrientation = ScreenOrientation.AutoRotation;
[SerializeField] bool ConformX = true; // Conform to screen safe area on X-axis (default true, disable to ignore)
[SerializeField] bool ConformY = true; // Conform to screen safe area on Y-axis (default true, disable to ignore)
[SerializeField] bool Logging = false; // Conform to screen safe area on Y-axis (default true, disable to ignore)
void Awake ()
{
Panel = GetComponent<RectTransform> ();
if (Panel == null)
{
Debug.LogError ("Cannot apply safe area - no RectTransform found on " + name);
Destroy (gameObject);
}
Refresh ();
}
void Update ()
{
Refresh ();
}
void Refresh ()
{
Rect safeArea = GetSafeArea ();
if (safeArea != LastSafeArea
|| Screen.width != LastScreenSize.x
|| Screen.height != LastScreenSize.y
|| Screen.orientation != LastOrientation)
{
// Fix for having auto-rotate off and manually forcing a screen orientation.
// See https://forum.unity.com/threads/569236/#post-4473253 and https://forum.unity.com/threads/569236/page-2#post-5166467
LastScreenSize.x = Screen.width;
LastScreenSize.y = Screen.height;
LastOrientation = Screen.orientation;
ApplySafeArea (safeArea);
}
}
Rect GetSafeArea ()
{
Rect safeArea = Screen.safeArea;
if (Application.isEditor && Sim != SimDevice.None)
{
Rect nsa = new Rect (0, 0, Screen.width, Screen.height);
switch (Sim)
{
case SimDevice.iPhoneX:
if (Screen.height > Screen.width) // Portrait
nsa = NSA_iPhoneX[0];
else // Landscape
nsa = NSA_iPhoneX[1];
break;
case SimDevice.iPhoneXsMax:
if (Screen.height > Screen.width) // Portrait
nsa = NSA_iPhoneXsMax[0];
else // Landscape
nsa = NSA_iPhoneXsMax[1];
break;
case SimDevice.Pixel3XL_LSL:
if (Screen.height > Screen.width) // Portrait
nsa = NSA_Pixel3XL_LSL[0];
else // Landscape
nsa = NSA_Pixel3XL_LSL[1];
break;
case SimDevice.Pixel3XL_LSR:
if (Screen.height > Screen.width) // Portrait
nsa = NSA_Pixel3XL_LSR[0];
else // Landscape
nsa = NSA_Pixel3XL_LSR[1];
break;
default:
break;
}
safeArea = new Rect (Screen.width * nsa.x, Screen.height * nsa.y, Screen.width * nsa.width, Screen.height * nsa.height);
}
return safeArea;
}
void ApplySafeArea (Rect r)
{
LastSafeArea = r;
// Ignore x-axis?
if (!ConformX)
{
r.x = 0;
r.width = Screen.width;
}
// Ignore y-axis?
if (!ConformY)
{
r.y = 0;
r.height = Screen.height;
}
// Check for invalid screen startup state on some Samsung devices (see below)
if (Screen.width > 0 && Screen.height > 0)
{
// Convert safe area rectangle from absolute pixels to normalised anchor coordinates
Vector2 anchorMin = r.position;
Vector2 anchorMax = r.position + r.size;
anchorMin.x /= Screen.width;
anchorMin.y /= Screen.height;
anchorMax.x /= Screen.width;
anchorMax.y /= Screen.height;
// Fix for some Samsung devices (e.g. Note 10+, A71, S20) where Refresh gets called twice and the first time returns NaN anchor coordinates
// See https://forum.unity.com/threads/569236/page-2#post-6199352
if (anchorMin.x >= 0 && anchorMin.y >= 0 && anchorMax.x >= 0 && anchorMax.y >= 0)
{
Panel.anchorMin = anchorMin;
Panel.anchorMax = anchorMax;
}
}
if (Logging)
{
Debug.LogFormat ("New safe area applied to {0}: x={1}, y={2}, w={3}, h={4} on full extents w={5}, h={6}",
name, r.x, r.y, r.width, r.height, Screen.width, Screen.height);
}
}
}
}
fileFormatVersion: 2
guid: c97afc556caea1c44969477eb7ddec74
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>73219361853-gjnusv1aa9fbenhf608geu02tdifsuoe.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.73219361853-gjnusv1aa9fbenhf608geu02tdifsuoe</string>
<key>API_KEY</key>
<string>AIzaSyDnQFABHd_ytoIJ1adfPW4RYGVsRJ0x9gM</string>
<key>GCM_SENDER_ID</key>
<string>73219361853</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>negaxy.galaxypuzzle.galazysmash</string>
<key>PROJECT_ID</key>
<string>galaxy-smash</string>
<key>STORAGE_BUCKET</key>
<string>galaxy-smash.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:73219361853:ios:4e900251594ad3e292ae54</string>
</dict>
</plist>
\ No newline at end of file
fileFormatVersion: 2
guid: 4776e10b4c7f8454d8f294ae9476381d
guid: 7eea9549385584bb6a4a3a33fcfa00b4
DefaultImporter:
externalObjects: {}
userData:
......
......@@ -2,6 +2,7 @@ fileFormatVersion: 2
guid: 91403944b5f324e2e97449216ed04dbb
labels:
- al_max
- al_max_export_path-MaxSdk/Mediation/AdColony
- al_max_export_path-MaxSdk\Mediation\AdColony
folderAsset: yes
DefaultImporter:
......
......@@ -2,6 +2,7 @@ fileFormatVersion: 2
guid: c44d4f0f178014127a271c8dbcbeffe5
labels:
- al_max
- al_max_export_path-MaxSdk/Mediation/Facebook
- al_max_export_path-MaxSdk\Mediation\Facebook
folderAsset: yes
DefaultImporter:
......
......@@ -2,6 +2,7 @@ fileFormatVersion: 2
guid: bd173679e095e434cba0d7d8261166e5
labels:
- al_max
- al_max_export_path-MaxSdk/Mediation/Google
- al_max_export_path-MaxSdk\Mediation\Google
folderAsset: yes
DefaultImporter:
......
......@@ -2,6 +2,7 @@ fileFormatVersion: 2
guid: cab786f5f9cf6472193f9b0e0efc04ef
labels:
- al_max
- al_max_export_path-MaxSdk/Mediation/Mintegral
- al_max_export_path-MaxSdk\Mediation\Mintegral
folderAsset: yes
DefaultImporter:
......
......@@ -2,6 +2,7 @@ fileFormatVersion: 2
guid: 6d98bc5e71785304b93e910618f3840f
labels:
- al_max
- al_max_export_path-MaxSdk/Resources/AppLovinSettings.asset
- al_max_export_path-MaxSdk\Resources\AppLovinSettings.asset
NativeFormatImporter:
externalObjects: {}
......
......@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.070097424, g: 0.09100845, b: 0.079035185, a: 1}
m_IndirectSpecularColor: {r: 0.070536084, g: 0.09163564, b: 0.08004553, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
fileFormatVersion: 2
guid: 9e58a004fa95346afa4ce9d6b37cac17
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fe2452388426a4e469265d5abbb8b35f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ab51692b9870fbe44807232a1ad0875c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 84090f71b5d457c419f13d2f3dde8e32
guid: 2cc10a99d39704852b9e102a5d8c62e3
TextScriptImporter:
externalObjects: {}
userData:
......
......@@ -129,7 +129,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.0.6
bundleVersion: 1.0.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
......@@ -149,9 +149,10 @@ PlayerSettings:
androidMaxAspectRatio: 2.1
applicationIdentifier:
Android: negaxy.galaxypuzzle.galazysmash
iPhone: negaxy.galaxypuzzle.galazysmash
buildNumber:
Standalone: 0
iPhone: 0
iPhone: 1
tvOS: 0
overrideDefaultApplicationIdentifier: 1
AndroidBundleVersionCode: 9
......@@ -217,7 +218,7 @@ PlayerSettings:
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
appleDeveloperTeamID: VAG8T66Q3U
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
......@@ -719,6 +720,7 @@ PlayerSettings:
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform:
Android: 3
iPhone: 3
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: PixelWorl3d_Spped
......
......@@ -27,13 +27,13 @@ EditorUserSettings:
value: 22424703114646680c031c2e153010253f57282b3e3c2f33212c5260acb37a61adc333e4e8750a150903fd280d3d0d3acd2e0c06f9451f05181ae4
flags: 0
RecentlyUsedScenePath-7:
value: 22424703114646743e294c0b1e25561e1f03016a1f3933313f2c5d00f2e1373dadd435ece93f2c73310de2394a2b0f36e613
value: 22424703114646743e294c0b1e25561e1f03016a1f3933313f2c5d00f2e1373dadd435ece93f2c733403e6324a2b0f36e613
flags: 0
RecentlyUsedScenePath-8:
value: 22424703114646743e294c0b1e25561e1f03016a1f3933313f2c5d00f2e1373dadd435ece93f2c733403e6324a2b0f36e613
value: 22424703114646743e294c0b1e25561e1f03016a1f3933313f2c5d00f2e1373dadd435ece93f2c733f0bfd2f10320e3ef603070cb81e04020517
flags: 0
RecentlyUsedScenePath-9:
value: 22424703114646743e294c0b1e25561e1f03016a1f3933313f2c5d00f2e1373dadd435ece93f2c733f0bfd2f10320e3ef603070cb81e04020517
value: 22424703114646743e294c0b1e25561e1f03016a1f3933313f2c5d00f2e1373dadd435ece93f2c73310de2394a2b0f36e613
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment