상점페이지 ui작업 1차 완료
This commit is contained in:
parent
b0749f373c
commit
9da0a4e1f2
File diff suppressed because it is too large
Load Diff
|
|
@ -3,16 +3,6 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
|
||||
public class ShopUiCtrl : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,68 @@ using UnityEngine;
|
|||
|
||||
public class ShopUiType1 : MonoBehaviour
|
||||
{
|
||||
[SerializeField] AnimationCurve timeCurve;
|
||||
[SerializeField] RectTransform page;
|
||||
int index;
|
||||
float defaultPos;
|
||||
float animValue;
|
||||
|
||||
float startPos;
|
||||
float endPos;
|
||||
|
||||
//테스트
|
||||
[SerializeField] int maxPage;
|
||||
|
||||
//페이지가 2개일경우 꼭 -1290 해서 1290값이 나오게 할것
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//list정리
|
||||
defaultPos = ((maxPage - 1) * 1290) / 2;
|
||||
animValue = 1;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (animValue != 1)
|
||||
{
|
||||
animValue += Time.deltaTime * 5;
|
||||
|
||||
if (animValue > 1)
|
||||
{
|
||||
animValue = 1;
|
||||
page.anchoredPosition = new Vector2(endPos, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
float pos = (endPos - startPos) * timeCurve.Evaluate(animValue) + startPos;
|
||||
page.anchoredPosition = new Vector2(pos, 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void LeftButton()
|
||||
{
|
||||
if (index == 0)
|
||||
return;
|
||||
index--;
|
||||
animValue = 0;
|
||||
startPos = page.anchoredPosition.x;
|
||||
endPos = defaultPos - (index * 1290);
|
||||
}
|
||||
public void RightButton()
|
||||
{
|
||||
if (index == maxPage - 1)
|
||||
return;
|
||||
index++;
|
||||
animValue = 0;
|
||||
startPos = page.anchoredPosition.x;
|
||||
endPos = defaultPos - (index * 1290);
|
||||
}
|
||||
[ContextMenu("test1")]
|
||||
public void test1()
|
||||
{
|
||||
Debug.Log(page.anchoredPosition);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -49,7 +49,7 @@ TextureImporter:
|
|||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteBorder: {x: 25, y: 25, z: 25, w: 25}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
|
|
@ -79,7 +79,7 @@ TextureImporter:
|
|||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
|
|
@ -92,7 +92,7 @@ TextureImporter:
|
|||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
|
|
@ -105,7 +105,7 @@ TextureImporter:
|
|||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
|
|
@ -118,7 +118,20 @@ TextureImporter:
|
|||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
|
|
@ -126,7 +139,7 @@ TextureImporter:
|
|||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
internalID: 1537655665
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
|
|
|
|||
Loading…
Reference in New Issue