Пример #1
0
    public float GetValue(AdaptiveRect referrenceGUI)
    {
        float ret = 0;

        switch (adaptivePointMode)
        {
        case AdaptivePointMode.RelativeToScreenLeft:
            return(Screen.width * Aspect);

        case AdaptivePointMode.RelativeToScreenTop:
            return(Screen.height * Aspect);

        case AdaptivePointMode.RelativeToReferrenceButtonTop:
            return(referrenceGUI.GetAnchor().y + this.RelativeReferrenceLength.GetValue(referrenceGUI.GetSize()));

            break;

        case AdaptivePointMode.RelativeToReferrenceButtonLeft:
            return(referrenceGUI.GetAnchor().x + this.RelativeReferrenceLength.GetValue(referrenceGUI.GetSize()));

            break;

        case AdaptivePointMode.Fixed:
        default:
            return(FixedValue);
        }
        return(ret);
    }
Пример #2
0
 public float GetValue(AdaptiveRect referrenceGUI)
 {
     float ret = 0;
     switch (adaptivePointMode)
     {
         case AdaptivePointMode.RelativeToScreenLeft:
             return Screen.width * Aspect;
         case AdaptivePointMode.RelativeToScreenTop:
             return Screen.height * Aspect;
         case AdaptivePointMode.RelativeToReferrenceButtonTop:
             return referrenceGUI.GetAnchor().y + this.RelativeReferrenceLength.GetValue(referrenceGUI.GetSize());
             break;
         case AdaptivePointMode.RelativeToReferrenceButtonLeft:
             return referrenceGUI.GetAnchor().x + this.RelativeReferrenceLength.GetValue(referrenceGUI.GetSize());
             break;
         case AdaptivePointMode.Fixed:
         default:
             return FixedValue;
     }
     return ret;
 }