Exemple #1
0
        public bool IsValid(TargetData data)
        {
            if (this.checkPlatform == true)
            {
                if (System.Array.IndexOf(this.runtimePlatforms, data.platform) < 0)
                {
                    return(false);
                }
            }

            if (this.checkAspects == true)
            {
                var aspect = data.screenSize.x / data.screenSize.y;
                for (int i = 0; i < this.aspects.items.Length; ++i)
                {
                    var item = this.aspects.items[i];
                    var from = item.aspectFrom.x / item.aspectFrom.y;
                    var to   = item.aspectTo.x / item.aspectTo.y;
                    var min  = Mathf.Min(from, to);
                    var max  = Mathf.Min(from, to);
                    if (aspect < min || aspect > max)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Exemple #2
0
        public bool IsValid(TargetData data)
        {
            if (this.target == null)
            {
                return(true);
            }

            return(this.target.IsValid(data));
        }