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."); } }
private void SetTempFields(IFactory factory) { _tempFactory = factory; _tempFactoryLevel = factory.GetLinkToIFactoryLevel(); }