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
    
  
  
    
  | Vector2 playerDir = player.transform.position - transform.position; | |
| var cross = velocity.x * playerDir.y - velocity.y * playerDir.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 OnMove() { | |
| var player = PlayerManager.Player; | |
| if ( player != null ) { | |
| // 自機の方向に回転する | |
| Vector2 playerDir = player.transform.position - transform.position; | |
| var cross = velocity.x * playerDir.y - velocity.y * playerDir.x; | |
| var rot = (cross > 0 ? angleSpeed : -angleSpeed) * Time.deltaTime; | |
| velocity = Quaternion.Euler(0, 0, rot) * velocity; | 
  
    
      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
    
  
  
    
  | [ContextMenu("ステージ配置データ保存")] | |
| private void SaveLayoutData() { | |
| Save(layouter.Convert()); | |
| } | |
| // マスターデータ保存 | |
| private void Save<T>(T obj) { | |
| var serializer = new JsonSerializer(); | |
| var path = EditorUtility.SaveFilePanel("", "/Assets/Project/Masters/Resources/", "", "json"); | 
  
    
      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 System; | |
| namespace Editor.Layout { | |
| /// <summary> | |
| /// エディタ用ステージ配置管理 | |
| /// </summary> | 
  
    
      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; | |
| namespace Editor.Layout { | |
| /// <summary> | |
| /// エディタ用ステージオブジェクト | |
| /// </summary> | |
| public class EditorStageObject : MonoBehaviour { | 
  
    
      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 OnChangeSprite() { | |
| // 次のスプライトを設定 | |
| spriteRenderer.sprite = sprites[current]; | |
| if ( ++current >= sprites.Length ) { | |
| // 次に表示するスプライトが無いので、消滅 | |
| Destroy(gameObject); | |
| return; | |
| } | 
  
    
      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.Stage; | |
| using UnityEngine; | |
| using UniRx; | |
| using System; | |
| using Core.App; | |
| namespace DPV.Effect { | |
| /// <summary> | |
| /// 爆発オブジェクト | |
| /// </summary> | 
  
    
      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
    
  
  
    
  | var resource = new CachedResource(); | |
| resource.Load<GameObject>("TestObject"); | |
| resource.Load<Texture2D>("TestTexture"); | 
  
    
      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 Core.Resource { | |
| /// <summary> | |
| /// リソースのキャッシュ管理 | |
| /// </summary> | |
| public class CachedResource : MonoBehaviour, IResource { | |
| // ロード済みオブジェクトのキャッシュ | 
  
    
      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 Core.Resource { | |
| /// <summary> | |
| /// リソース管理 | |
| /// </summary> | |
| public interface IResource { | |
| T Load<T>(string path) where T : Object; |