신규 UI추가
This commit is contained in:
parent
389d0dffda
commit
fb3e6738a4
File diff suppressed because it is too large
Load Diff
|
|
@ -1,24 +0,0 @@
|
||||||
using MEC;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEditor.VersionControl;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ImgaeSizeSet : MonoBehaviour
|
|
||||||
{
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
Timing.RunCoroutine(ImageSet());
|
|
||||||
}
|
|
||||||
private IEnumerator<float> ImageSet()
|
|
||||||
{
|
|
||||||
yield return Timing.WaitForSeconds(0.1f);
|
|
||||||
RectTransform rt = gameObject.GetComponent<RectTransform>();
|
|
||||||
RectTransform changeRt = gameObject.GetComponentsInChildren<RectTransform>()[1];
|
|
||||||
float sizeSet = (rt.sizeDelta.y / 2) - 10;
|
|
||||||
changeRt.offsetMin = new Vector2(-sizeSet, 10.0f);
|
|
||||||
changeRt.offsetMax = new Vector2(sizeSet, -10.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
using MEC;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Unity.VisualScripting;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class BuildingCtrl : MonoBehaviour
|
||||||
|
{
|
||||||
|
public bool isProduction;
|
||||||
|
public int lineCount;
|
||||||
|
public int buildingLevel;
|
||||||
|
|
||||||
|
private void Start()
|
||||||
|
{
|
||||||
|
Timing.RunCoroutine(BuildingSet());
|
||||||
|
}
|
||||||
|
private IEnumerator<float> BuildingSet()
|
||||||
|
{
|
||||||
|
yield return Timing.WaitForSeconds(0.1f);
|
||||||
|
//ui재정렬
|
||||||
|
RectTransform rt = gameObject.GetComponent<RectTransform>();
|
||||||
|
RectTransform changeRt = gameObject.GetComponentsInChildren<RectTransform>()[1];
|
||||||
|
float sizeSet = (rt.sizeDelta.y / 2) - 10;
|
||||||
|
changeRt.offsetMin = new Vector2(-sizeSet, 10.0f);
|
||||||
|
changeRt.offsetMax = new Vector2(sizeSet, -10.0f);
|
||||||
|
|
||||||
|
//나의정보 playerCtrl에 전달
|
||||||
|
//PlayCtrl.Instance.player.buildings[lineCount].
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Button()
|
||||||
|
{
|
||||||
|
if(isProduction || buildingLevel != 0)//생산건물 이거나 일반건물 레벨업
|
||||||
|
{
|
||||||
|
PlayCtrl.Instance.buildingLevelupUI.SetActive(true);
|
||||||
|
PlayCtrl.Instance.newBuildingUI.SetActive(false);
|
||||||
|
PlayCtrl.Instance.backButton.SetActive(true);
|
||||||
|
}
|
||||||
|
else //신규건물 생산
|
||||||
|
{
|
||||||
|
PlayCtrl.Instance.buildingLevelupUI.SetActive(false);
|
||||||
|
PlayCtrl.Instance.newBuildingUI.SetActive(true);
|
||||||
|
PlayCtrl.Instance.backButton.SetActive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -17,14 +17,23 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
|
|
||||||
public GameObject unit;
|
public GameObject unit;
|
||||||
|
|
||||||
|
public GameObject newBuildingUI;
|
||||||
|
public GameObject buildingLevelupUI;
|
||||||
|
public GameObject backButton;
|
||||||
|
|
||||||
public SummonsUnit player;
|
public SummonsUnit player;
|
||||||
public SummonsUnit enemy;
|
public SummonsUnit enemy;
|
||||||
|
|
||||||
|
//선택된 ui의 정보를 저장할 수 있게 만들기.
|
||||||
|
//레벨업 ui만들기
|
||||||
|
//backbutton을 누르면 둘다 꺼지게 만들기.
|
||||||
|
|
||||||
protected override void OnAwake()
|
protected override void OnAwake()
|
||||||
{
|
{
|
||||||
summons = 0.1f;
|
summons = 0.1f;
|
||||||
slider.value = 0;
|
slider.value = 0;
|
||||||
stage = 0;
|
stage = 0;
|
||||||
|
uiExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveCamera(float move)
|
public void MoveCamera(float move)
|
||||||
|
|
@ -64,4 +73,12 @@ public class PlayCtrl : SingletonMonoBehaviour<PlayCtrl>
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void uiExit()
|
||||||
|
{
|
||||||
|
newBuildingUI.SetActive(false);
|
||||||
|
buildingLevelupUI.SetActive(false);
|
||||||
|
backButton.SetActive(false);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -79,7 +79,7 @@ TextureImporter:
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
|
|
@ -92,7 +92,7 @@ TextureImporter:
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
|
|
@ -105,7 +105,7 @@ TextureImporter:
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Server
|
buildTarget: Server
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
|
|
@ -118,7 +118,7 @@ TextureImporter:
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
|
@ -126,7 +126,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