public bool IsValid()
            {
                var result = true;

                if (result == true && this.platform == true)
                {
                    result = false;
                    var platform = WindowSystem.GetCurrentRuntimePlatform();
                    for (int i = 0; i < this.anyOfPlatform.Length; ++i)
                    {
                        if (this.anyOfPlatform[i] == platform)
                        {
                            result = true;
                            break;
                        }
                    }
                }

                if (result == true && this.aspect == true)
                {
                    var delta      = 0.001f;
                    var aspectSize = Screen.width / (float)Screen.height;
                    var checkTo    = this.aspectFrom.x / this.aspectFrom.y;
                    var checkFrom  = this.aspectTo.x / this.aspectTo.y;

                    //Debug.LogError("---------- CHECK: " + aspectSize + " :: " + Screen.width + " :: " + Screen.height + " // " + checkFrom + " // " + checkTo);
                    result = ((aspectSize >= checkFrom - delta) && (aspectSize <= checkTo + delta));
                }

                return(result);
            }
Exemple #2
0
 public static TargetData GetTargetData()
 {
     return(new TargetData()
     {
         platform = WindowSystem.GetCurrentRuntimePlatform(),
         screenSize = new Vector2(Screen.width, Screen.height)
     });
 }
Exemple #3
0
            public virtual bool IsValid()
            {
                if (this.oneOfPlatforms.Length == 0)
                {
                    return(true);
                }

                var checkPlatform = WindowSystem.GetCurrentRuntimePlatform();

                for (int i = 0; i < this.oneOfPlatforms.Length; ++i)
                {
                    if (checkPlatform == this.oneOfPlatforms[i])
                    {
                        return(true);
                    }
                }

                return(false);
            }