コード例 #1
0
 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));
 }