Skip to content

Instantly share code, notes, and snippets.

View saitocastel1900's full-sized avatar
🎮
Game Dev

Ryoma Saito(Dedicated School Account) saitocastel1900

🎮
Game Dev
  • Individual
  • Kanagawa, Japan
View GitHub Profile
using System;
using UniRx;
using UnityEngine;
namespace Gauge
{
public class Presenter : IDisposable
{
//view
private View _view;
using System;
using UniRx;
using UnityEngine;
namespace Gauge
{
public class Model
{
public IReadOnlyReactiveProperty<int> Value => _value;
private IntReactiveProperty _value { set; get; }
using UniRx;
using UnityEngine;
namespace Gauge
{
public class Presenter : MonoBehaviour
{
//view
[SerializeField] private View _view;
//model
using System;
using TMPro;
using UniRx;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
namespace Gauge
{
public class View : MonoBehaviour
if (other.gameObject.tag == "爆弾")
{
other.GetComponent<IIgnited>();
hit?.Ignited(damege, this.gameObject);
}
if (other.gameObject.name=="爆弾")
{
other.GetComponent<IIgnited>();
hit?.Ignited(damege, this.gameObject);
private void OnTriggerEnter(Collider other)
{
//それぞれのヒット処理を呼び出す
var hit = other.GetComponent<IIgnited>();
hit?.Ignited(damege, this.gameObject);
}
public abstract class Enemy : MonoBehaviour
{
protected string _name;
protected int _hp;
public abstract string GetName();
public abstract int GetHp();
public abstract void Attack(int damaged);
}
public abstract class EnemyCreator
{
public abstract Enemy Create(string name,int hp);
}
using UnityEngine;
public class FactoryTest : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
var augerCreator = new AugerCreator();
var auger=augerCreator.Create("鬼1",120);
auger.Attack(120);
public class AugerCreator : EnemyCreator
{
public override Enemy Create(string name, int hp)
{
Enemy enemy = new Auger(name,hp);
return enemy;
}
}