Commit fc192fef authored by 18신대성's avatar 18신대성 Committed by 18손재민

코멘트 생기는거 WIP

이제 맵숫자 1부터 시작
parent a6dcfb84
{"objects":[{"tag":0,"xPos":20.0,"yPos":0.0},{"tag":2,"xPos":-0.5,"yPos":1.0},{"tag":2,"xPos":-0.5,"yPos":-1.0},{"tag":2,"xPos":-0.5,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":1.0},{"tag":9,"xPos":-2.0,"yPos":1.0},{"tag":1,"xPos":-1.0,"yPos":1.0},{"tag":1,"xPos":0.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":0.0},{"tag":1,"xPos":0.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":-1.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":-1.0,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":-2.0},{"tag":1,"xPos":0.0,"yPos":-2.0},{"tag":4,"xPos":1.0,"yPos":-2.0}],"clears":[{"type":0,"goal":1}],"cases":[],"bullets":[]}
\ No newline at end of file
{"objects":[{"tag":0,"xPos":20.0,"yPos":0.0},{"tag":2,"xPos":-0.5,"yPos":1.0},{"tag":2,"xPos":-0.5,"yPos":-1.0},{"tag":2,"xPos":-0.5,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":1.0},{"tag":9,"xPos":-2.0,"yPos":1.0},{"tag":1,"xPos":-1.0,"yPos":1.0},{"tag":1,"xPos":0.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":1.0},{"tag":1,"xPos":1.0,"yPos":0.0},{"tag":1,"xPos":0.0,"yPos":0.0},{"tag":1,"xPos":-1.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":0.0},{"tag":1,"xPos":-2.0,"yPos":-1.0},{"tag":1,"xPos":-1.0,"yPos":-1.0},{"tag":1,"xPos":0.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-1.0},{"tag":1,"xPos":1.0,"yPos":-2.0},{"tag":1,"xPos":-1.0,"yPos":-2.0},{"tag":1,"xPos":-2.0,"yPos":-2.0},{"tag":1,"xPos":0.0,"yPos":-2.0},{"tag":4,"xPos":1.0,"yPos":-2.0}],"clears":[{"type":0,"goal":1}],"cases":[],"bullets":[],"comments":"hello stage 1"}
\ No newline at end of file
......@@ -9,6 +9,7 @@ public class GameManager : SingletonBehaviour<GameManager>
[Space(10)]
public ClearUIGenerator uiGenerator;
public BulletUIGenerator bulletUIGenerator;
public CommentUIGenerator commentUIGenerator;
public Image whiteout;
[Space(10)]
......
......@@ -86,6 +86,11 @@ public class MapManager : SingletonBehaviour<MapManager>
PlayerController.inst.CreatePlayer(currentMap.startFloors[i]);
for (int i = 0; i < loadedMapData.bullets.Count; i++)
PlayerController.inst.AddBullet(loadedMapData.bullets[i]);
if (loadedMapData.comments != null)
{
currentMap.comments = loadedMapData.comments;
GameManager.inst.commentUIGenerator.SetComment(currentMap.comments);
}
}
public IEnumerator Rebaker()
......
......@@ -14,9 +14,11 @@ public class Map : MonoBehaviour
public GameObject floors;
public GameObject walls;
public GameObject objects;
[Header("Stage Data")]
public List<Floor> startFloors;
public List<BulletCode> initialBullets;
public string comments;
public List<ClearCondition> clearConditions;
/// <summary>
......
......@@ -31,6 +31,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public List<clearData> clears;
public List<BulletCode> cases;
public List<BulletCode> bullets;
public string comments = null;
public MapSaveData()
{
objects = new List<objectData>();
......
......@@ -15,7 +15,7 @@ public class StageSelector : MonoBehaviour
{
if(i < 0 && selectedStage == 0) selectedStage = totalStageCount - 1;
else selectedStage = (selectedStage + i) % totalStageCount;
stageIndex.text = "Stage : " + selectedStage;
stageIndex.text = "Stage : " + (selectedStage + 1);
}
public void StartSelectedStage()
......
......@@ -6,6 +6,7 @@ using UnityEngine.UI;
public class BulletUIGenerator : MonoBehaviour
{
public GameObject bulletUI;
public Transform bulletUIParent;
public GameObject targetBulletUI;
public List<GameObject> uiList;
......@@ -17,7 +18,7 @@ public class BulletUIGenerator : MonoBehaviour
public void GenerateBulletUI(BulletCode code)
{
GameObject bulletUIInst = Instantiate(bulletUI, transform);
GameObject bulletUIInst = Instantiate(bulletUI, bulletUIParent);
bulletUIInst.transform.localPosition = new Vector3(posX, posY);
posX -= 60;
......
......@@ -5,6 +5,7 @@ using UnityEngine;
public class ClearUIGenerator : MonoBehaviour
{
public GameObject clearUI;
public Transform clearUIParent;
public List<GameObject> uiList;
private int nextx = -175;
......@@ -15,7 +16,7 @@ public class ClearUIGenerator : MonoBehaviour
{
foreach (ClearCondition cond in MapManager.inst.currentMap.clearConditions)
{
GameObject uiObject = Instantiate(clearUI, transform);
GameObject uiObject = Instantiate(clearUI, clearUIParent);
uiList.Add(uiObject);
ClearStatusUI ui = uiObject.GetComponent<ClearStatusUI>();
ui.GetComponent<RectTransform>().anchoredPosition = new Vector2(nextx, nexty);
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CommentUIGenerator : MonoBehaviour
{
public GameObject commentUI;
public Text comment;
public string commentString = "";
public bool isViewed = false;
public void SetComment(string commentStr)
{
commentString = commentStr;
comment.text = commentString;
commentUI.SetActive(true);
}
IEnumerator FadeOut()
{
yield return new WaitForSeconds(5f);
float currentTime = Time.time;
for (; currentTime + 5000 >= Time.time;)
{
yield return null;
}
}
}
fileFormatVersion: 2
guid: 375ecde44acb181449f97b4269c7f740
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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