以下の内容はhttps://baba-s.hatenablog.com/entry/2021/11/03/082000より取得しました。


【Unity】Corgi Engine でプレイヤーがやられたかどうか検知する方法

概要

using System;
using MoreMountains.CorgiEngine;
using MoreMountains.Tools;
using UnityEngine;

public sealed class PlayerDeathListener :
    MonoBehaviour,
    MMEventListener<CorgiEngineEvent>
{
    public event Action OnDead;

    private void OnEnable()
    {
        this.MMEventStartListening();
    }

    private void OnDisable()
    {
        this.MMEventStopListening();
    }

    public void OnMMEvent( CorgiEngineEvent eventType )
    {
        if ( eventType.EventType != CorgiEngineEventTypes.PlayerDeath ) return;

        OnDead?.Invoke();
    }
}

上記のようなスクリプトを作成する




以上の内容はhttps://baba-s.hatenablog.com/entry/2021/11/03/082000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14