예제 #1
0
 private void Start()
 {
     red = GetComponent <FlashRed>();
     if (red != null)
     {
         OnDamageReceived += red.TintRed;
     }
 }
예제 #2
0
 private void Awake()
 {
     try
     {
         red = GetComponent <FlashRed>();
         if (red == null)
         {
             throw new System.Exception($"GameObject: { gameObject.name} has no component FlashRed");
         }
     }
     catch (System.Exception e)
     {
         Debug.Log(e.Message);
     }
 }