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":[]} {"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 \ No newline at end of file
...@@ -9,6 +9,7 @@ public class GameManager : SingletonBehaviour<GameManager> ...@@ -9,6 +9,7 @@ public class GameManager : SingletonBehaviour<GameManager>
[Space(10)] [Space(10)]
public ClearUIGenerator uiGenerator; public ClearUIGenerator uiGenerator;
public BulletUIGenerator bulletUIGenerator; public BulletUIGenerator bulletUIGenerator;
public CommentUIGenerator commentUIGenerator;
public Image whiteout; public Image whiteout;
[Space(10)] [Space(10)]
......
...@@ -86,6 +86,11 @@ public class MapManager : SingletonBehaviour<MapManager> ...@@ -86,6 +86,11 @@ public class MapManager : SingletonBehaviour<MapManager>
PlayerController.inst.CreatePlayer(currentMap.startFloors[i]); PlayerController.inst.CreatePlayer(currentMap.startFloors[i]);
for (int i = 0; i < loadedMapData.bullets.Count; i++) for (int i = 0; i < loadedMapData.bullets.Count; i++)
PlayerController.inst.AddBullet(loadedMapData.bullets[i]); PlayerController.inst.AddBullet(loadedMapData.bullets[i]);
if (loadedMapData.comments != null)
{
currentMap.comments = loadedMapData.comments;
GameManager.inst.commentUIGenerator.SetComment(currentMap.comments);
}
} }
public IEnumerator Rebaker() public IEnumerator Rebaker()
......
...@@ -14,9 +14,11 @@ public class Map : MonoBehaviour ...@@ -14,9 +14,11 @@ public class Map : MonoBehaviour
public GameObject floors; public GameObject floors;
public GameObject walls; public GameObject walls;
public GameObject objects; public GameObject objects;
[Header("Stage Data")]
public List<Floor> startFloors; public List<Floor> startFloors;
public List<BulletCode> initialBullets; public List<BulletCode> initialBullets;
public string comments;
public List<ClearCondition> clearConditions; public List<ClearCondition> clearConditions;
/// <summary> /// <summary>
......
...@@ -31,6 +31,7 @@ public class MapEditor : SingletonBehaviour<MapEditor> ...@@ -31,6 +31,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public List<clearData> clears; public List<clearData> clears;
public List<BulletCode> cases; public List<BulletCode> cases;
public List<BulletCode> bullets; public List<BulletCode> bullets;
public string comments = null;
public MapSaveData() public MapSaveData()
{ {
objects = new List<objectData>(); objects = new List<objectData>();
......
...@@ -15,7 +15,7 @@ public class StageSelector : MonoBehaviour ...@@ -15,7 +15,7 @@ public class StageSelector : MonoBehaviour
{ {
if(i < 0 && selectedStage == 0) selectedStage = totalStageCount - 1; if(i < 0 && selectedStage == 0) selectedStage = totalStageCount - 1;
else selectedStage = (selectedStage + i) % totalStageCount; else selectedStage = (selectedStage + i) % totalStageCount;
stageIndex.text = "Stage : " + selectedStage; stageIndex.text = "Stage : " + (selectedStage + 1);
} }
public void StartSelectedStage() public void StartSelectedStage()
......
...@@ -6,6 +6,7 @@ using UnityEngine.UI; ...@@ -6,6 +6,7 @@ using UnityEngine.UI;
public class BulletUIGenerator : MonoBehaviour public class BulletUIGenerator : MonoBehaviour
{ {
public GameObject bulletUI; public GameObject bulletUI;
public Transform bulletUIParent;
public GameObject targetBulletUI; public GameObject targetBulletUI;
public List<GameObject> uiList; public List<GameObject> uiList;
...@@ -17,7 +18,7 @@ public class BulletUIGenerator : MonoBehaviour ...@@ -17,7 +18,7 @@ public class BulletUIGenerator : MonoBehaviour
public void GenerateBulletUI(BulletCode code) public void GenerateBulletUI(BulletCode code)
{ {
GameObject bulletUIInst = Instantiate(bulletUI, transform); GameObject bulletUIInst = Instantiate(bulletUI, bulletUIParent);
bulletUIInst.transform.localPosition = new Vector3(posX, posY); bulletUIInst.transform.localPosition = new Vector3(posX, posY);
posX -= 60; posX -= 60;
......
...@@ -5,6 +5,7 @@ using UnityEngine; ...@@ -5,6 +5,7 @@ using UnityEngine;
public class ClearUIGenerator : MonoBehaviour public class ClearUIGenerator : MonoBehaviour
{ {
public GameObject clearUI; public GameObject clearUI;
public Transform clearUIParent;
public List<GameObject> uiList; public List<GameObject> uiList;
private int nextx = -175; private int nextx = -175;
...@@ -15,7 +16,7 @@ public class ClearUIGenerator : MonoBehaviour ...@@ -15,7 +16,7 @@ public class ClearUIGenerator : MonoBehaviour
{ {
foreach (ClearCondition cond in MapManager.inst.currentMap.clearConditions) foreach (ClearCondition cond in MapManager.inst.currentMap.clearConditions)
{ {
GameObject uiObject = Instantiate(clearUI, transform); GameObject uiObject = Instantiate(clearUI, clearUIParent);
uiList.Add(uiObject); uiList.Add(uiObject);
ClearStatusUI ui = uiObject.GetComponent<ClearStatusUI>(); ClearStatusUI ui = uiObject.GetComponent<ClearStatusUI>();
ui.GetComponent<RectTransform>().anchoredPosition = new Vector2(nextx, nexty); 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