public void AssignQuad(OptimizedQuadPolyImage rhs)
 {
     this.quad.LT = rhs.quad.LT;
     this.quad.RT = rhs.quad.RT;
     this.quad.RB = rhs.quad.RB;
     this.quad.LB = rhs.quad.LB;
     this.SetVerticesDirty();
 }
Пример #2
0
        public bool ContainsFrom(OptimizedQuadPolyImage img)
        {
            if (!img)
            {
                return(false);
            }

            return(img == this.from);
        }
Пример #3
0
        public bool ContainsTo(OptimizedQuadPolyImage img)
        {
            if (!img)
            {
                return(false);
            }

            for (int n = 0, cnt = this.to.Count; n < cnt; ++n)
            {
                var to = this.to[n];
                if (!to)
                {
                    continue;
                }

                if (img == to)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        protected override void OnEditorSetting()
        {
            base.OnEditorSetting();

            if (this.editorRebuild)
            {
                this.editorRebuild = false;
                this.to.Clear();
                for (int n = 0, cnt = this.editorRebuildToGroups.Length; n < cnt; ++n)
                {
                    var group = this.editorRebuildToGroups[n];
                    if (!group)
                    {
                        continue;
                    }

                    var imgs = group.FindComponentsInChildren <OptimizedQuadPolyImage>();
                    foreach (var img in imgs)
                    {
                        if (img && !this.Contains(img))
                        {
                            this.to.Add(img);
                        }
                    }
                }

                if (!this.from)
                {
                    var img = this.FindComponent <OptimizedQuadPolyImage>();
                    if (img && !this.Contains(img))
                    {
                        this.from = img;
                    }
                }
            }

            this.Apply();
        }
Пример #5
0
 public bool Contains(OptimizedQuadPolyImage img)
 {
     return(this.ContainsFrom(img) ? true : this.ContainsTo(img));
 }