コード例 #1
0
ファイル: Localize.cs プロジェクト: GRXing/Frame
        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;
            }
        }
コード例 #2
0
ファイル: Localize.cs プロジェクト: Siran1994/HillsOfSteel
 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;
     }
 }
コード例 #3
0
ファイル: Localize.cs プロジェクト: Siran1994/HillsOfSteel
 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;
     }
 }