Symbols.OnGUI C# (CSharp) Méthode

OnGUI() public méthode

public OnGUI ( ) : void
Résultat void
    void OnGUI()
    {
        scale.y = Screen.height/oh;
        scale.x = Screen.width/ow;
        scale.z = 1;
        float scaleX = Screen.width/ow;
        GUI.matrix = Matrix4x4.TRS(new Vector3((scaleX - scale.y)/2 * ow,0,0),Quaternion.identity,scale);
        GUI.depth = -1;

        if(this.transform.GetComponent<Menu>().on == true) {
            GUI.Label (new Rect(760,435,70,70),buildTexture);
            GUI.Label (new Rect(760,520,70,70),passTexture);
            if(TowerSelection.GetSelectedSection() != null) {
                if(!(TowerSelection.GetSelectedSection() != null && TowerSelection.GetSelectedSection().attributes.sp >= TowerSelection.GetSelectedSection().attributes.maxSP)) {
                    GUI.Label (new Rect(760,255,50,50),fortifyTexture);
                }
                if (!(TowerSelection.GetSelectedSection() != null && (TowerSelection.GetSelectedSection().GetWeaponInfo() == "Nothing" || TurnOrder.ceasefire > TurnOrder.turnNum))) {
                    GUI.Label (new Rect(760,375,50,50),fightTexture);
                }
                if(!(TowerSelection.GetSelectedSection() != null && TowerSelection.GetSelectedSection().attributes.weapon.GetUpgradeLevel() >= TowerSelection.GetSelectedSection().attributes.weapon.maxUpgradeLevel)) {
                    GUI.Label (new Rect(760,315,50,50),upgradeTexture);
                }
            }
        }
    }