void Start() { /*Type[] types = current_unit.GetType().GetInterfaces(); * foreach(Type t in types) * { * Debug.Log(t.Name); * if(t.Name == "IModule") * { * * module = current_unit as Building.IModule; * Debug.Log(module.GetType().Name); * * } * } * Type tp = current_unit.GetType().BaseType; * if (tp.Name == "BuilingMain") * { * * Building.BuilingMain builingMain = current_unit as Building.BuilingMain; * Debug.Log(builingMain.GetType().Name); * * } */ IOperating iop = gameObject.AddComponent <BasisControl>(); AddOperating(iop); }
public void AddOperating(IOperating iop) { operating.Add(iop); operating[operating.Count - 1].Enter(this); }