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 logger = new ConsoleLogger(); | |
| logger.Log("ほげほげ"); | |
| logger.Log("ふがふが", Color.red); |
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 { | |
| /// <summary> | |
| /// コンソールログ出力管理 | |
| /// </summary> | |
| public class ConsoleLogger : ILogger { |
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
| Debug.Log("<color=red>ほげほげ</color>"); |
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 { | |
| public interface ILogger { | |
| void Log(object message); | |
| void Log(object message, Color color); | |
| } |
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
| Debug.Log("ほげほげ"); |
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
| shootButton.OnDown.Subscribe(_ => playerShooter.BeginShoot()); | |
| shootButton.OnUp.Subscribe(_ => playerShooter.EndShoot()); |
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
| playerShooter = GetComponent<IPlayerShooter>(); | |
| if ( playerShooter != null ) { | |
| // 自機ショット発射 | |
| var shootButton = AppCore.Input.GetButton(ButtonDef.Shoot); | |
| shootButton.OnDown.Subscribe(_ => playerShooter.BeginShoot()); | |
| shootButton.OnUp.Subscribe(_ => playerShooter.EndShoot()); | |
| } |
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 area = movableArea.rect; | |
| area.xMin += radius; | |
| area.xMax -= radius; | |
| area.yMin += radius; | |
| area.yMax -= radius; | |
| if ( pos.x < area.xMin ) { | |
| pos.x = area.xMin; | |
| } |
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 pos = transform.position; | |
| pos += AppCore.Input.Axis * speed * Time.deltaTime; |
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() { | |
| // 位置更新 | |
| Vector2 pos = transform.position; | |
| pos += AppCore.Input.Axis * speed * Time.deltaTime; | |
| // 位置補正 | |
| var area = movableArea.rect; | |
| area.xMin += radius; | |
| area.xMax -= radius; |