示例#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);
     }
 }