protected void CheckAndHandleInputChange()
 {
     if (input != null)
     {
         Layer newInputLayer = input.GetComponent <Layer>();
         if (!newInputLayer.IsInitialized())
         {
             newInputLayer.Init();
         }
         if (_inputLayer != newInputLayer)
         {
             if (_inputLayer != null)
             {
                 _inputLayer.RemoveObserver(this);
             }
             newInputLayer.AddObserver(this);
             _inputLayer = newInputLayer;
         }
     }
     else
     {
         if (_inputLayer != null)
         {
             _inputLayer.RemoveObserver(this);
         }
         _inputLayer = null;
     }
 }