예제 #1
0
 private void InitFields()
 {
     _transform      = transform;
     _cargoGenerator = GetComponent <ICargoGenerator>();
     _factoryLevel   = GetComponent <IFactoryLevel>();
     if (_factorySprite == null)
     {
         throw new Exception("Установите поле Factory Sprite.");
     }
     if (_factoryLevel == null)
     {
         throw new NullReferenceException("No component that implements the IFactoryLevel interface was found.");
     }
     if (_cargoGenerator == null)
     {
         throw new NullReferenceException("No component that implements the ICargoGenerator interface was found.");
     }
 }
예제 #2
0
 private void SetTempFields(IFactory factory)
 {
     _tempFactory      = factory;
     _tempFactoryLevel = factory.GetLinkToIFactoryLevel();
 }