Пример #1
0
        void RefreshContainerForShape(BaseDisposable updatedComponent)
        {
            UIShape childComponent = updatedComponent as UIShape;

            Assert.IsTrue(childComponent != null, "This should never happen!!!!");

            if (((UIShape.Model)childComponent.GetModel()).parentComponent != id)
            {
                RefreshAll();
                return;
            }

            GameObject stackContainer = null;

            if (!stackContainers.ContainsKey(childComponent.id))
            {
                stackContainer = Object.Instantiate(Resources.Load("UIContainerStackChild")) as GameObject;
#if UNITY_EDITOR
                stackContainer.name = "UIContainerStackChild - " + childComponent.id;
#endif
                stackContainers.Add(childComponent.id, stackContainer);

                int oldSiblingIndex = childComponent.referencesContainer.transform.GetSiblingIndex();
                childComponent.referencesContainer.transform.SetParent(stackContainer.transform, false);
                stackContainer.transform.SetParent(referencesContainer.childHookRectTransform, false);
                stackContainer.transform.SetSiblingIndex(oldSiblingIndex);
            }
            else
            {
                stackContainer = stackContainers[childComponent.id];
            }

            RefreshAll();
        }
 bool MaterialInfo.IsVisible()
 {
     if (!((UIShape.Model)shape.GetModel()).visible)
     {
         return(false);
     }
     return(IsParentVisible(shape));
 }
Пример #3
0
        public void OnPointerDown(PointerEventData eventData)
        {
            UIShape.Model ownerModel = (UIShape.Model)owner.GetModel();

            if (VERBOSE)
            {
                Debug.Log("pointer current raycast: " + eventData.pointerCurrentRaycast,
                          eventData.pointerCurrentRaycast.gameObject);
                Debug.Log("pointer press raycast: " + eventData.pointerPressRaycast,
                          eventData.pointerPressRaycast.gameObject);
            }

            if (!string.IsNullOrEmpty(ownerModel.onClick) &&
                eventData.pointerPressRaycast.gameObject == childHookRectTransform.gameObject)
            {
                WebInterface.ReportOnClickEvent(owner.scene.sceneData.id, ownerModel.onClick);
            }
        }