ゲーム開発奮闘記

Unity・エフェクト・アプリ開発に関係した記事を書いています

Unity メモ :親に当たるGameObjectへSendMessageを送る

公式リファレンスより
Component.SendMessageUpwards

using UnityEngine;
using System.Collections;
              
public class Example : 
              MonoBehaviour {
    void ApplyDamage(float damage) {
        print(damage);
    }
    void Example() {
        SendMessageUpwards("ApplyDamage", 5.0F);
    }
}


人気ブログランキングへ