孙广东 2016.10.15
http://blog.csdn.net/u010019717
功能类似于 GetComponents 等函数:
1、 不用接口, 使用抽象类 继承自 Monobehaiour
public abstract class LayerPanelBase :MonoBehaviour
{
public abstract void InitView(HeroModel heroModel, CharacterAttributeView characterAttributeView);
}
然后执行 .GetComponent<LayerPanelBase>().InitView(myHeroModel, this);
2、原理类似 网上百度可见的:
原帖:
http://forum.unity3d.com/threads/60596-GetComponents-Possible-to-use-with-C-Interfaces
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using Syste