Advertisement

[Unity&接口]子类既继承接口类也继承MonoBehaviour的快速操作与重构实现

阅读量:

Unity接口类继承以及继承MonoBehaviour

在Unity开发过程中,若希望一个类同时继承MonoBehaviour与接口类,应采取何种实现方式

----------------------------------------------------------------------------------------------------------------

TC_IWeapon 类的具体定义如下所示

复制代码
 using System.Collections.Generic;

    
 using UnityEngine;
    
 //using System.Collections;
    
  
    
 public interface TC_IWeapon
    
 {
    
     List<TC_BaseStat> Stat { get; set; }
    
     void PerformAttack();
    
 }
    
    
    
    
复制代码
 using System

全部评论 (0)

还没有任何评论哟~