public void EnableSaveButton(bool enable)
    {
        GUICollider component = this.saveButton.GetComponent <GUICollider>();

        UISprite[] componentsInChildren = component.GetComponentsInChildren <UISprite>();
        float      colorRate            = 1f;

        if (enable)
        {
            component.CallBackClass = base.gameObject;
            component.touchBehavior = GUICollider.TouchBehavior.ToLarge;
            if (!this.enableSaveButton)
            {
                colorRate = 2.5f;
            }
        }
        else
        {
            component.CallBackClass = null;
            component.touchBehavior = GUICollider.TouchBehavior.None;
            if (this.enableSaveButton)
            {
                colorRate = 0.4f;
            }
        }
        this.enableSaveButton = enable;
        this.SetButtonColor(componentsInChildren, colorRate);
    }
    public void EnableStoreButton(bool enable)
    {
        GUICollider component = this.storeButton.GetComponent <GUICollider>();

        this.EnableButton(component, enable);
        UISprite[] componentsInChildren = component.GetComponentsInChildren <UISprite>();
        if (enable)
        {
            if (!this.enableStoreButton)
            {
                this.SetButtonColor(componentsInChildren, 2.5f);
            }
        }
        else if (this.enableStoreButton)
        {
            this.SetButtonColor(componentsInChildren, 0.4f);
        }
        this.enableStoreButton = enable;
    }
Esempio n. 3
0
    private void EnableYesButton(bool enable)
    {
        GUICollider component = this.yesButton.GetComponent <GUICollider>();

        UISprite[] componentsInChildren = component.GetComponentsInChildren <UISprite>();
        float      num = 1f;

        if (enable)
        {
            component.CallBackClass = base.gameObject;
            component.touchBehavior = GUICollider.TouchBehavior.ToLarge;
            if (!this.enableYesButton)
            {
                num = 2.5f;
            }
        }
        else
        {
            component.CallBackClass = null;
            component.touchBehavior = GUICollider.TouchBehavior.None;
            if (this.enableYesButton)
            {
                num = 0.4f;
            }
        }
        this.enableYesButton = enable;
        foreach (UISprite uisprite in componentsInChildren)
        {
            Color color = uisprite.color;
            float num2  = num;
            color.r        = Mathf.Clamp01(color.r * num2);
            color.g        = Mathf.Clamp01(color.g * num2);
            color.b        = Mathf.Clamp01(color.b * num2);
            uisprite.color = color;
        }
    }