我是靠谱客的博主 慈祥黄蜂,这篇文章主要介绍关于 public interface{} 接口的设置,现在分享给大家,希望可以做个参考。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/// <summary>
/// 所有子弹的接口。
/// </summary>
public interface Test
{
    void SetDamage(int damage);
    int GetDamage();
    void Fire(Transform target);
}

public class Testtttttttt : MonoBehaviour, Test
{

Transform target;

    int damage = 1;
    public void Fire(Transform target)
    {
        this.target = target;
    }

    public int GetDamage()
    {
        return damage;
    }

    public void SetDamage(int damage)
    {
        this.damage = damage;
    }

}

最后

以上就是慈祥黄蜂最近收集整理的关于关于 public interface{} 接口的设置的全部内容,更多相关关于内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部