コード例 #1
0
        public AppSettingsDialog CreateAppSettingsDialog()
        {
            Canvas            level3Canvas      = this.Level3Canvas ?? this.MainCanvas;
            AppSettingsDialog appSettingsDialog = UnityEngine.Object.Instantiate <AppSettingsDialog>(this.m_appSettingsDialogPrefab, level3Canvas.transform, false);

            appSettingsDialog.gameObject.name = "AppSettingsDialog";
            appSettingsDialog.gameObject.SetActive(true);
            TiledRandomTexture[] componentsInChildren    = this.m_appSettingsDialogPrefab.GetComponentsInChildren <TiledRandomTexture>();
            TiledRandomTexture[] tiledRandomTextureArray = appSettingsDialog.GetComponentsInChildren <TiledRandomTexture>();
            for (int i = 0; i < (int)tiledRandomTextureArray.Length; i++)
            {
                TiledRandomTexture tiledRandomTexture = tiledRandomTextureArray[i];
                RectTransform      rectTransform      = tiledRandomTexture.transform as RectTransform;
                Rect rect = rectTransform.rect;
                TiledRandomTexture tiledRandomTexture1 = componentsInChildren.FirstOrDefault <TiledRandomTexture>((TiledRandomTexture tex) => tex.gameObject.name == tiledRandomTexture.gameObject.name);
                if (tiledRandomTexture1 != null)
                {
                    RectTransform rectTransform1 = tiledRandomTexture1.transform as RectTransform;
                    rectTransform.localScale       = rectTransform1.localScale;
                    rectTransform.anchoredPosition = rectTransform1.anchoredPosition;
                }
            }
            return(appSettingsDialog);
        }
コード例 #2
0
        public AppSettingsDialog CreateAppSettingsDialog()
        {
            Canvas            canvas            = this.Level3Canvas ?? this.MainCanvas;
            AppSettingsDialog appSettingsDialog = Object.Instantiate <AppSettingsDialog>(this.m_appSettingsDialogPrefab, canvas.transform, false);

            appSettingsDialog.gameObject.name = "AppSettingsDialog";
            appSettingsDialog.gameObject.SetActive(true);
            TiledRandomTexture[] componentsInChildren  = this.m_appSettingsDialogPrefab.GetComponentsInChildren <TiledRandomTexture>();
            TiledRandomTexture[] componentsInChildren2 = appSettingsDialog.GetComponentsInChildren <TiledRandomTexture>();
            for (int i = 0; i < componentsInChildren2.Length; i++)
            {
                TiledRandomTexture divider       = componentsInChildren2[i];
                RectTransform      rectTransform = divider.transform as RectTransform;
                Rect rect = rectTransform.rect;
                TiledRandomTexture tiledRandomTexture = componentsInChildren.FirstOrDefault((TiledRandomTexture tex) => tex.gameObject.name == divider.gameObject.name);
                if (tiledRandomTexture != null)
                {
                    RectTransform rectTransform2 = tiledRandomTexture.transform as RectTransform;
                    rectTransform.localScale       = rectTransform2.localScale;
                    rectTransform.anchoredPosition = rectTransform2.anchoredPosition;
                }
            }
            return(appSettingsDialog);
        }