Esempio n. 1
0
 private void Start()
 {
     control = GetComponent <IGameObjectDamageTaker>();
     if (control == null)
     {
         throw new System.Exception("This GameObject doesnt have a IGameObjectDamageTaker and can thus not recieve physical damage.");
     }
 }
Esempio n. 2
0
 private void Start()
 {
     damageTaker = GetComponent <IGameObjectDamageTaker>();
     if (damageTaker == null)
     {
         Debug.LogError("FallDamageTaker is on a GameObject that cannot take damage.");
         Destroy(this);
     }
 }