示例#1
0
        public void Setup(Graphic targetGraphic, SyncGraphic syncGraphic)
        {
            this.targetGraphic = targetGraphic;
            this.syncGraphic   = syncGraphic;

            targetGraphicTransform = targetGraphic.rectTransform;
            syncGraphicTransform   = syncGraphic.rectTransform;
        }
        void SetupZoomGraphic(Graphic graphic, Transform zoomItemParent)
        {
            ZoomItemEffect effect = graphic.GetComponent <ZoomItemEffect>();

            if (effect == null)
            {
                effect = graphic.gameObject.AddComponent <ZoomItemEffect>();
            }

            GameObject zoomItem = new GameObject(graphic.name + "(ZoomItemGraphic)");

            zoomItem.transform.SetParent(zoomItemParent);

            SyncGraphic syncGraphic = zoomItem.AddComponent <SyncGraphic>();

            syncGraphic.Setup(graphic);

            effect.Setup(graphic, syncGraphic);

            zoomGraphicList.Add(new ZoomGraphic()
            {
                zoomItemEffect = effect, graphic = syncGraphic
            });
        }