コード例 #1
0
ファイル: ControlMain.cs プロジェクト: ru4tk4/SW_Project
        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);
        }
コード例 #2
0
ファイル: ControlMain.cs プロジェクト: ru4tk4/SW_Project
 public void AddOperating(IOperating iop)
 {
     operating.Add(iop);
     operating[operating.Count - 1].Enter(this);
 }