Beispiel #1
0
 void TryInitialize()
 {
     if (!initialized)
     {
         animation   = GetAnimation();
         initialized = true;
     }
 }
Beispiel #2
0
            public void Create(WindowBase window, Transform modulesRoot)
            {
                var instance = this.moduleSource.Spawn();

                instance.transform.SetParent(modulesRoot);
                instance.transform.localPosition = Vector3.zero;
                instance.transform.localRotation = Quaternion.identity;
                instance.transform.localScale    = Vector3.one;

                var rect = instance.transform as RectTransform;

                rect.sizeDelta        = (this.moduleSource.transform as RectTransform).sizeDelta;
                rect.anchoredPosition = (this.moduleSource.transform as RectTransform).anchoredPosition;

                instance.transform.SetSiblingIndex(this.backgroundLayer == true ? -this.sortingOrder : this.sortingOrder + 1);

                instance.Setup(window);

                this.instance = instance;
            }