This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ステージにオブジェクトを配置する | |
| private GameObject Put(LayoutRow layout) { | |
| var obj = MasterManager.Instance.LoadObject(layout.obj_id); | |
| obj.transform.SetParent(root); | |
| obj.transform.position = new Vector3(layout.x, layout.y); | |
| obj.transform.rotation = Quaternion.Euler(0, 0, layout.rot); | |
| obj.transform.localScale = new Vector3(layout.sx, layout.sy, 1); | |
| var velocity = new Vector2(layout.vx, layout.vy); | |
| foreach ( var motion in obj.GetComponents<IShootableMotion>() ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 次のオブジェクトを配置する | |
| private void OnLayoutNext() { | |
| var nextLayouts = layoutMaster.GetNext(); | |
| if ( nextLayouts.Length > 0 ) { | |
| var nextTime = nextLayouts[0].time; | |
| Observable.Timer(TimeSpan.FromMilliseconds(nextTime)) | |
| .Subscribe(x => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 初期化 | |
| private void Start() { | |
| // TODO : 途中ステージからでもロードできるように対応する | |
| var firstStage = MasterManager.Instance.FirstStage; | |
| layoutMaster = MasterManager.Instance.LoadLayout(firstStage); | |
| OnLayoutNext(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using DPV.Master; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UniRx; | |
| using UniRx.Triggers; | |
| using System; | |
| using Core.App; | |
| using DPV.Motion; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace DPV.Master { | |
| /// <summary> | |
| /// マスター管理 | |
| /// </summary> | |
| public interface IMaster { | |
| void Load(string path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace DPV.Master { | |
| /// <summary> | |
| /// メインマスター管理 | |
| /// </summary> | |
| public class MainMaster : IMaster { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // マスターデータ保存 | |
| private void Save<T>(T obj) { | |
| var serializer = new JsonSerializer(); | |
| var path = EditorUtility.SaveFilePanel("", "/Assets/Project/Masters/Resources/", "", "json"); | |
| if ( string.IsNullOrEmpty(path) ) { | |
| return; | |
| } | |
| using ( var sw = new FileStream(path, FileMode.Create) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using DPV.Master; | |
| using UnityEditor; | |
| using System.IO; | |
| namespace DPV { | |
| public class MasterMaker : MonoBehaviour { | |
| [SerializeField] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace DPV.Master { | |
| /// <summary> | |
| /// JSON形式のシリアライザ | |
| /// </summary> | |
| public class JsonSerializer : IMasterSerializer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| namespace DPV.Master { | |
| /// <summary> | |
| /// マスターデータのシリアライザ | |
| /// </summary> | |
| public interface IMasterSerializer { | |
| byte[] Serialize<T>(T obj); |