Commit cccb28ba authored by 18류지석's avatar 18류지석

생명석 UI 갈아엎기 WIP. LifeStoneUI 프리팹 머지하고 UI에 넣어야함

parent 58e64dab
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1702490942761452}
m_IsPrefabAsset: 1
--- !u!1 &1702490942761452
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 4314497980557940}
- component: {fileID: 212836983556063948}
m_Layer: 0
m_Name: LC01
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4314497980557940
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1702490942761452}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 10, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &212836983556063948
SpriteRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1702490942761452}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 137b0e8d2160bab45893f33e02df312a, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.12, y: 0.12}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
fileFormatVersion: 2
guid: 64e119a3b05f7e643a2873db8c703f88
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
...@@ -9,31 +9,31 @@ Prefab: ...@@ -9,31 +9,31 @@ Prefab:
m_Modifications: [] m_Modifications: []
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 0} m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1322655041097828} m_RootGameObject: {fileID: 1001509239983906}
m_IsPrefabAsset: 1 m_IsPrefabAsset: 1
--- !u!1 &1322655041097828 --- !u!1 &1001509239983906
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 224014778143931040} - component: {fileID: 224060403346354144}
- component: {fileID: 222104465596639276} - component: {fileID: 222893837463442406}
- component: {fileID: 114742953498515424} - component: {fileID: 114603089856174522}
m_Layer: 5 m_Layer: 5
m_Name: LC m_Name: standardImage
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!114 &114742953498515424 --- !u!114 &114603089856174522
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1322655041097828} m_GameObject: {fileID: 1001509239983906}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
...@@ -47,7 +47,7 @@ MonoBehaviour: ...@@ -47,7 +47,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 137b0e8d2160bab45893f33e02df312a, type: 3} m_Sprite: {fileID: 0}
m_Type: 0 m_Type: 0
m_PreserveAspect: 0 m_PreserveAspect: 0
m_FillCenter: 1 m_FillCenter: 1
...@@ -55,28 +55,28 @@ MonoBehaviour: ...@@ -55,28 +55,28 @@ MonoBehaviour:
m_FillAmount: 1 m_FillAmount: 1
m_FillClockwise: 1 m_FillClockwise: 1
m_FillOrigin: 0 m_FillOrigin: 0
--- !u!222 &222104465596639276 --- !u!222 &222893837463442406
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1322655041097828} m_GameObject: {fileID: 1001509239983906}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!224 &224014778143931040 --- !u!224 &224060403346354144
RectTransform: RectTransform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1322655041097828} m_GameObject: {fileID: 1001509239983906}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: -301.1, y: -139}
m_SizeDelta: {x: 24, y: 24} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
fileFormatVersion: 2 fileFormatVersion: 2
guid: a413c94742056eb42a0fb2896e81d287 guid: a48de94a6ab80f746aec69a02812f1e3
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 100100000 mainObjectFileID: 0
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
...@@ -9,74 +9,131 @@ Prefab: ...@@ -9,74 +9,131 @@ Prefab:
m_Modifications: [] m_Modifications: []
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 0} m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1211859245884242} m_RootGameObject: {fileID: 1939101680453256}
m_IsPrefabAsset: 1 m_IsPrefabAsset: 1
--- !u!1 &1211859245884242 --- !u!1 &1820862295034228
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6 serializedVersion: 6
m_Component: m_Component:
- component: {fileID: 224350874834166432} - component: {fileID: 224255635903845628}
- component: {fileID: 222774389294574794}
- component: {fileID: 114744092900330078}
m_Layer: 5 m_Layer: 5
m_Name: Row m_Name: LifeStoneFrame
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!114 &114744092900330078 --- !u!1 &1874721051176178
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224871102929798118}
m_Layer: 5
m_Name: LifeStones
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1939101680453256
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224402251087470820}
- component: {fileID: 114920782405449110}
m_Layer: 5
m_Name: LifeStoneUI
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114920782405449110
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211859245884242} m_GameObject: {fileID: 1939101680453256}
m_Enabled: 1 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: 11500000, guid: 7fe540ec78947fc449eabc76bd87823d, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} lifeStoneLocation: {x: 7, y: 7}
m_Color: {r: 1, g: 1, b: 1, a: 1} standardImage: {fileID: 1001509239983906, guid: a48de94a6ab80f746aec69a02812f1e3,
m_RaycastTarget: 1 type: 2}
m_OnCullStateChanged: lifeStoneRow: 8
m_PersistentCalls: lifeStoneSize: 12
m_Calls: [] sprites:
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - {fileID: 21300004, guid: eff441d843b9c664e97a81fcb39d8410, type: 3}
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - {fileID: 21300002, guid: eff441d843b9c664e97a81fcb39d8410, type: 3}
m_Sprite: {fileID: 21300008, guid: 0c2144d8f09991444a79e6880da13b8f, type: 3} - {fileID: 21300000, guid: eff441d843b9c664e97a81fcb39d8410, type: 3}
m_Type: 0 - {fileID: 21300000, guid: c8304f5a15856324fa6a4c5ae11bd279, type: 3}
m_PreserveAspect: 0 frameSuper: {fileID: 1820862295034228}
m_FillCenter: 1 stoneSuper: {fileID: 1874721051176178}
m_FillMethod: 4 lifeStoneFrame: {fileID: 0}
m_FillAmount: 1 --- !u!224 &224255635903845628
m_FillClockwise: 1 RectTransform:
m_FillOrigin: 0
--- !u!222 &222774389294574794
CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211859245884242} m_GameObject: {fileID: 1820862295034228}
m_CullTransparentMesh: 0 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
--- !u!224 &224350874834166432 m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224402251087470820}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &224402251087470820
RectTransform: RectTransform:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0} m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1211859245884242} m_GameObject: {fileID: 1939101680453256}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children:
- {fileID: 224255635903845628}
- {fileID: 224871102929798118}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 64, y: 24} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &224871102929798118
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1874721051176178}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224402251087470820}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
fileFormatVersion: 2 fileFormatVersion: 2
guid: ca7d9c696ba7ff24ea005093ae955d1a guid: c179f0931cfabec428a868a6edc543b0
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 100100000 mainObjectFileID: 100100000
......
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class Player : MonoBehaviour { public class Player : MonoBehaviour {
public LifeCrystalUI LCUI; public LifeStoneManager LCUI;
public static int tx, ty; public static int tx, ty;
public int ttx; public int ttx;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LifeCrystal : MonoBehaviour
{
/// <summary>
/// Integer array representation of LifeCrystal shape
/// <para/> First index: width, 0 on the left
/// <para/> Second index: height, o on the bottom
/// </summary>
public LifeCrystalUI.CellType[][] grid;
/// <summary>
/// Initiaization
/// </summary>
void Start ()
{
int cellCount = transform.childCount;
LifeCrystalUI.CellType[][] gridCopy = new LifeCrystalUI.CellType[3][]
{
new LifeCrystalUI.CellType[3],
new LifeCrystalUI.CellType[3],
new LifeCrystalUI.CellType[3]
};
int maxX = 1, maxY = 1;
for(int i = 0; i < cellCount; i++)
{
Transform cell = transform.GetChild(i);
Vector2Int cellPosition = new Vector2Int(Mathf.RoundToInt(cell.localPosition.x), Mathf.RoundToInt(cell.localPosition.y));
gridCopy[cellPosition.x][cellPosition.y] = LifeCrystalUI.CellType.Life;
if (maxX < cellPosition.x) maxX = cellPosition.x;
if (maxY < cellPosition.y) maxY = cellPosition.y;
}
grid = new LifeCrystalUI.CellType[maxX + 1][];
for (int i = 0; i <= maxX; i++)
{
grid[i] = new LifeCrystalUI.CellType[maxY + 1];
for (int j = 0; j <= maxY; j++)
{
grid[i][j] = gridCopy[i][j];
}
}
}
/// <summary>
/// Randomly upgrade cells
/// </summary>
/// <param name="tier">Tier</param>
public void Upgrade(int tier)
{
}
}
This diff is collapsed.
fileFormatVersion: 2 fileFormatVersion: 2
guid: a68e01f0fb856c94ebb4cbd2fd3b04d4 guid: 92b4226af0f466e4cab0fd67e3e58127
NativeFormatImporter: folderAsset: yes
DefaultImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 100100000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LifeStoneFrame : MonoBehaviour {
/// <summary>
/// The frame top image
/// </summary>
GameObject frameTop;
/// <summary>
/// The frame rows images
/// </summary>
GameObject[] frameRows;
/// <summary>
/// The frame bottom image
/// </summary>
GameObject frameBottom;
/// <summary>
/// The number of lifeStoneRows
/// </summary>
int lifeStoneRow;
/// <summary>
/// Size of lifeStone
/// </summary>
float lifeStoneSize;
/// <summary>
/// The sprites
/// </summary>
Sprite[] sprites;
public LifeStoneFrame(Transform superGO, GameObject standardImage, int lifeStoneRow, float lifeStoneSize, Sprite[] _sprites)
{
sprites = new Sprite[_sprites.GetLength(0)];
_sprites.CopyTo(sprites, 0);
this.lifeStoneRow = lifeStoneRow;
this.lifeStoneSize = lifeStoneSize;
frameBottom = Instantiate(standardImage,superGO);
frameBottom.name = "FrameBottom";
frameBottom.GetComponent<Image>().sprite = sprites[0];
frameBottom.GetComponent<RectTransform>().sizeDelta = new Vector2(lifeStoneSize * 3.4f, lifeStoneSize * 0.2f);
frameBottom.transform.localPosition = new Vector3(0, 0);
frameRows = new GameObject[50];
for(int i=0; i<lifeStoneRow; i++)
{
frameRows[i] = Instantiate(standardImage, superGO);
frameRows[i].name = "FrameRow" + i.ToString("D2");
frameRows[i].GetComponent<Image>().sprite = sprites[1];
frameRows[i].GetComponent<RectTransform>().sizeDelta = new Vector2(lifeStoneSize * 3.4f, lifeStoneSize);
frameRows[i].transform.localPosition = new Vector3(0, lifeStoneSize * (0.2f + i));
}
frameTop = Instantiate(standardImage, superGO);
frameTop.name = "FrameTop";
frameTop.GetComponent<Image>().sprite = sprites[2];
frameTop.GetComponent<RectTransform>().sizeDelta = new Vector2(lifeStoneSize * 3.4f, lifeStoneSize * 0.2f);
frameTop.transform.localPosition = new Vector3(0, lifeStoneSize * (0.2f + lifeStoneRow));
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: 60f8b2083eab5134ead2083cd318cbc0 guid: 2674542376dfab04bad27caaa3ffe6a1
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LifeStoneInfo : MonoBehaviour {
/// <summary>
/// width, height of LifeStone
/// ex) □
/// □□
/// □
/// (2,3)
/// </summary>
Vector2Int size;
/// <summary>
/// contents of LifeStone from bottom left.
/// A: Normal lifestone
/// B: Gold lifestone
/// C: Amethyst lifestone
///
/// ex) A
/// BC
/// A
/// "A BC A"
/// </summary>
string fill;
LifeStoneInfo(Vector2Int size, string fill)
{
this.size = size;
this.fill = fill;
}
public Vector2Int getSize()
{
return size;
}
public string getFill()
{
return fill;
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3a9b430bb1c39ea4e9820b5c6510da1f guid: 3adfb54ead68b8142ba9e3c4f7c1d67b
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent (typeof(RectTransform))]
public class LifeStoneManager : MonoBehaviour {
/// <summary>
/// Location of lifeStoneFrame on Canvas
/// </summary>
public Vector2 lifeStoneLocation;
/// <summary>
/// standard prefab of every image
/// </summary>
public GameObject standardImage;
/// <summary>
/// The number of lifeStoneRows
/// </summary>
public int lifeStoneRow;
/// <summary>
/// Size of lifeStone
/// </summary>
public float lifeStoneSize;
/// <summary>
/// The sprites
/// </summary>
public Sprite[] sprites;
/// <summary>
/// super Object of frames
/// </summary>
public GameObject frameSuper;
/// <summary>
/// super Object fo stones
/// </summary>
public GameObject stoneSuper;
/// <summary>
/// Array of lifestone
/// 0 row is the bottom
/// 0: empty
/// 1: normal lifestone
/// 2: gold lifestone
/// 3: amethyst lifestone
/// </summary>
public int[,] lifeStoneArray;
[HideInInspector]public LifeStoneFrame lifeStoneFrame;
void Start () {
transform.position = new Vector3(lifeStoneLocation.x, lifeStoneLocation.y, 0);
lifeStoneFrame = new LifeStoneFrame(frameSuper.transform, standardImage, lifeStoneRow, lifeStoneSize, sprites);
lifeStoneArray = new int[50, 3];
for (int i = 0; i < 50; i++) for (int j = 0; j < 3; j++) lifeStoneArray[i, j] = 0;
}
void PushLifeStone(LifeStoneInfo pushInfo)
{
Vector2Int pSize = pushInfo.getSize();
string pFill = pushInfo.getFill();
int[] minRow = new int[] { lifeStoneRow, lifeStoneRow, lifeStoneRow};
{
int i, j, pi, pj;
for (i = 0; i < 3 - pSize.x; i++)
{
for (j = lifeStoneRow - 1; j >= 0; j--)
{
for (pi = 0; pi < pSize.x; pi++)
{
for (pj = 0; pj < pSize.y; pj++)
{
if (pFill[pj * pSize.x + pi] != ' ' && lifeStoneArray[j + pj, i + pi] != 0) break;
}
if (pj != pSize.y) break;
}
if (pi != pSize.x) break;
}
}
}
}
}
fileFormatVersion: 2
guid: 7fe540ec78947fc449eabc76bd87823d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: 65aea5b3c412c3443abb6931a7a0acf4 guid: 577209e861351da49b2a8eb2f9e556f2
NativeFormatImporter: folderAsset: yes
DefaultImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 100100000
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: 137b0e8d2160bab45893f33e02df312a guid: c8304f5a15856324fa6a4c5ae11bd279
timeCreated: 1530887932
licenseType: Free
TextureImporter: TextureImporter:
fileIDToRecycleName: fileIDToRecycleName:
21300000: LC_0 21300000: lifestone_normal
21300002: LC_1 21300002: lifestone_gold
21300004: LC_2 externalObjects: {}
serializedVersion: 4 serializedVersion: 6
mipmaps: mipmaps:
mipMapMode: 0 mipMapMode: 0
enableMipMap: 0 enableMipMap: 0
...@@ -15,6 +13,8 @@ TextureImporter: ...@@ -15,6 +13,8 @@ TextureImporter:
linearTexture: 0 linearTexture: 0
fadeOut: 0 fadeOut: 0
borderMipMap: 0 borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1 mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3 mipMapFadeDistanceEnd: 3
bumpmap: bumpmap:
...@@ -23,6 +23,8 @@ TextureImporter: ...@@ -23,6 +23,8 @@ TextureImporter:
heightScale: 0.25 heightScale: 0.25
normalMapFilter: 0 normalMapFilter: 0
isReadable: 0 isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
...@@ -30,10 +32,13 @@ TextureImporter: ...@@ -30,10 +32,13 @@ TextureImporter:
textureFormat: 1 textureFormat: 1
maxTextureSize: 2048 maxTextureSize: 2048
textureSettings: textureSettings:
serializedVersion: 2
filterMode: 0 filterMode: 0
aniso: -1 aniso: -1
mipBias: -1 mipBias: -100
wrapMode: 1 wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0 nPOTScale: 0
lightmap: 0 lightmap: 0
compressionQuality: 50 compressionQuality: 50
...@@ -42,76 +47,103 @@ TextureImporter: ...@@ -42,76 +47,103 @@ TextureImporter:
spriteMeshType: 1 spriteMeshType: 1
alignment: 0 alignment: 0
spritePivot: {x: 0.5, y: 0.5} spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100 spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1 alphaUsage: 1
alphaIsTransparency: 1 alphaIsTransparency: 1
spriteTessellationDetail: -1 spriteTessellationDetail: -1
textureType: 8 textureType: 8
textureShape: 1 textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0 maxTextureSizeSet: 0
compressionQualitySet: 0 compressionQualitySet: 0
textureFormatSet: 0 textureFormatSet: 0
platformSettings: platformSettings:
- buildTarget: DefaultTexturePlatform - serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 1 textureCompression: 1
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
overridden: 0 overridden: 0
- buildTarget: Standalone androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 1 textureCompression: 1
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
overridden: 0 overridden: 0
androidETC2FallbackOverride: 0
spriteSheet: spriteSheet:
serializedVersion: 2 serializedVersion: 2
sprites: sprites:
- serializedVersion: 2 - serializedVersion: 2
name: LC_0 name: lifestone_normal
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 0 y: 0
width: 12 width: 20
height: 12 height: 20
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
tessellationDetail: 0
- serializedVersion: 2
name: LC_1
rect:
serializedVersion: 2
x: 12
y: 0
width: 12
height: 12
alignment: 0 alignment: 0
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
outline: [] outline: []
physicsShape: []
tessellationDetail: 0 tessellationDetail: 0
bones: []
spriteID: 538cbab2232ea69499413b121f59def9
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2 - serializedVersion: 2
name: LC_2 name: lifestone_gold
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 24 x: 20
y: 0 y: 0
width: 12 width: 20
height: 12 height: 20
alignment: 0 alignment: 0
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
outline: [] outline: []
physicsShape: []
tessellationDetail: 0 tessellationDetail: 0
bones: []
spriteID: 1add30bf6efdfb246babef5980d4472f
vertices: []
indices:
edges: []
weights: []
outline: [] outline: []
physicsShape: []
bones: []
spriteID: eaa16ca24f230d643b2c9d0ed47c9e5e
vertices: []
indices:
edges: []
weights: []
spritePackingTag: spritePackingTag:
userData: userData:
assetBundleName: assetBundleName:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0c2144d8f09991444a79e6880da13b8f guid: eff441d843b9c664e97a81fcb39d8410
TextureImporter: TextureImporter:
fileIDToRecycleName: fileIDToRecycleName:
21300000: LifeCrystal Mold_0 21300000: lifestoneframe_top
21300002: LifeCrystal Mold_1 21300002: lifestoneframe_row
21300004: LifeCrystal Mold_2 21300004: lifestoneframe_bottom
21300006: LC Mold_0
21300008: LC Mold_1
21300010: LC Mold_2
externalObjects: {} externalObjects: {}
serializedVersion: 6 serializedVersion: 6
mipmaps: mipmaps:
...@@ -69,7 +66,7 @@ TextureImporter: ...@@ -69,7 +66,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 0 textureCompression: 1
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
...@@ -80,7 +77,7 @@ TextureImporter: ...@@ -80,7 +77,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 0 textureCompression: 1
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
...@@ -91,7 +88,7 @@ TextureImporter: ...@@ -91,7 +88,7 @@ TextureImporter:
maxTextureSize: 2048 maxTextureSize: 2048
resizeAlgorithm: 0 resizeAlgorithm: 0
textureFormat: -1 textureFormat: -1
textureCompression: 0 textureCompression: 1
compressionQuality: 50 compressionQuality: 50
crunchedCompression: 0 crunchedCompression: 0
allowsAlphaSplitting: 0 allowsAlphaSplitting: 0
...@@ -101,13 +98,13 @@ TextureImporter: ...@@ -101,13 +98,13 @@ TextureImporter:
serializedVersion: 2 serializedVersion: 2
sprites: sprites:
- serializedVersion: 2 - serializedVersion: 2
name: LC Mold_0 name: lifestoneframe_top
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 24 y: 24
width: 32 width: 68
height: 12 height: 4
alignment: 0 alignment: 0
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
...@@ -115,19 +112,19 @@ TextureImporter: ...@@ -115,19 +112,19 @@ TextureImporter:
physicsShape: [] physicsShape: []
tessellationDetail: 0 tessellationDetail: 0
bones: [] bones: []
spriteID: 128ab26cacbd51b4db5c1070a5caf159 spriteID: cfc8c98264a9eea4fb3c899de66f26cf
vertices: [] vertices: []
indices: indices:
edges: [] edges: []
weights: [] weights: []
- serializedVersion: 2 - serializedVersion: 2
name: LC Mold_1 name: lifestoneframe_row
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 12 y: 4
width: 32 width: 68
height: 12 height: 20
alignment: 0 alignment: 0
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
...@@ -135,19 +132,19 @@ TextureImporter: ...@@ -135,19 +132,19 @@ TextureImporter:
physicsShape: [] physicsShape: []
tessellationDetail: 0 tessellationDetail: 0
bones: [] bones: []
spriteID: 2d5922a3fd758df4d9cb9e3571d9fb15 spriteID: a9fd97cc2ec11ba4aab76c8a520f4495
vertices: [] vertices: []
indices: indices:
edges: [] edges: []
weights: [] weights: []
- serializedVersion: 2 - serializedVersion: 2
name: LC Mold_2 name: lifestoneframe_bottom
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 0 x: 0
y: 0 y: 0
width: 32 width: 68
height: 12 height: 4
alignment: 0 alignment: 0
pivot: {x: 0, y: 0} pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
...@@ -155,7 +152,7 @@ TextureImporter: ...@@ -155,7 +152,7 @@ TextureImporter:
physicsShape: [] physicsShape: []
tessellationDetail: 0 tessellationDetail: 0
bones: [] bones: []
spriteID: e8f18c3e6da7ce64cb99cd17b5d9be3b spriteID: b45259dd2b68ef541b644001de849e0b
vertices: [] vertices: []
indices: indices:
edges: [] edges: []
...@@ -163,7 +160,7 @@ TextureImporter: ...@@ -163,7 +160,7 @@ TextureImporter:
outline: [] outline: []
physicsShape: [] physicsShape: []
bones: [] bones: []
spriteID: 8d50ca77c4c7b6c488d6a0a75cc0fe69 spriteID: 31e4d26878a81c549a591e3d79d2616d
vertices: [] vertices: []
indices: indices:
edges: [] edges: []
......
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