Ejemplo n.º 1
0
 public virtual void BindToEntity(Entity source)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     Source = source;
     if (!Source.TryGetComponent(out cPosition))
     {
         throw new InvalidOperationException(string.Format("'{0}' does not contain a {1}", source.Name, cPosition.GetType()));
     }
     if (!source.TryGetComponent(out cRotation))
     {
         throw new InvalidOperationException(string.Format("'{0}' does not contain a {1}", source.Name, cRotation.GetType()));
     }
     if (!source.TryGetComponent(out cUpdate))
     {
         throw new InvalidOperationException(string.Format("'{0}' does not contain a {1}", source.Name, cUpdate.GetType()));
     }
 }