void FindAndCacheTarget(ref GameObject targetCache, DelegateSetFinalTerms setFinalTerms, DelegateDoLocalize doLocalize, bool UseSecondaryTerm, bool MainRTL, bool SecondRTL) { if (mTarget != targetCache && targetCache) { #if UNITY_EDITOR DestroyImmediate(targetCache); #else Destroy(targetCache); #endif } if (mTarget != null) { targetCache = (mTarget as GameObject); } else { Transform mThis = transform; mTarget = targetCache = (mThis.childCount < 1 ? null : mThis.GetChild(0).gameObject); } if (targetCache != null) { EventSetFinalTerms = setFinalTerms; EventDoLocalize = doLocalize; CanUseSecondaryTerm = UseSecondaryTerm; AllowMainTermToBeRTL = MainRTL; AllowSecondTermToBeRTL = SecondRTL; } }
public void FindAndCacheTarget <T>(ref T targetCache, DelegateSetFinalTerms setFinalTerms, DelegateDoLocalize doLocalize, bool UseSecondaryTerm, bool MainRTL, bool SecondRTL) where T : Component { if (mTarget != null) { targetCache = (mTarget as T); } else { mTarget = (targetCache = GetComponent <T>()); } if ((UnityEngine.Object)targetCache != (UnityEngine.Object)null) { EventSetFinalTerms = setFinalTerms; EventDoLocalize = doLocalize; CanUseSecondaryTerm = UseSecondaryTerm; AllowMainTermToBeRTL = MainRTL; AllowSecondTermToBeRTL = SecondRTL; } }
private void FindAndCacheTarget(ref GameObject targetCache, DelegateSetFinalTerms setFinalTerms, DelegateDoLocalize doLocalize, bool UseSecondaryTerm, bool MainRTL, bool SecondRTL) { if (mTarget != targetCache && (bool)targetCache) { UnityEngine.Object.Destroy(targetCache); } if (mTarget != null) { targetCache = (mTarget as GameObject); } else { Transform transform = base.transform; mTarget = (targetCache = ((transform.childCount < 1) ? null : transform.GetChild(0).gameObject)); } if (targetCache != null) { EventSetFinalTerms = setFinalTerms; EventDoLocalize = doLocalize; CanUseSecondaryTerm = UseSecondaryTerm; AllowMainTermToBeRTL = MainRTL; AllowSecondTermToBeRTL = SecondRTL; } }