Пример #1
0
    public void addHashedButton(string hashString_, int hashInt, superButtonType type, string hint)
    {
        gameUIbutton hashedButton = new gameUIbutton();
        string       hashString   = hashString_;

        if (hashString == "")
        {
            hashString = hashInt.ToString();
        }
        hashedButton.hashString = hashString;
        hashedButton.response   = hashInt;
        hashedButton.gameObject = Program.I().create(Program.I().new_ui_superButtonTransparent);
        UIHelper.trySetLableText(hashedButton.gameObject, "hint_", hint);
        UIHelper.getRealEventGameObject(hashedButton.gameObject).name = hashString + "----" + hashInt.ToString();
        UIHelper.registUIEventTriggerForClick(hashedButton.gameObject, listenerForClicked);
        hashedButton.gameObject.GetComponent <iconSetForButton>().setTexture(type);
        hashedButton.gameObject.GetComponent <iconSetForButton>().setText(hint);
        Transform[] Transforms = hashedButton.gameObject.GetComponentsInChildren <Transform>();
        foreach (Transform child in Transforms)
        {
            child.gameObject.layer = instance_btnPan.gameObject.layer;
        }
        hashedButton.gameObject.transform.SetParent(instance_btnPan.transform, false);
        hashedButton.gameObject.transform.localScale       = Vector3.zero;
        hashedButton.gameObject.transform.localPosition    = Vector3.zero;
        hashedButton.gameObject.transform.localEulerAngles = Vector3.zero;
        iTween.ScaleTo(hashedButton.gameObject, new Vector3(0.9f, 0.9f, 0.9f), 0.3f);
        HashedButtons.Add(hashedButton);
        refreshLine();
    }
Пример #2
0
    public gameButton(int response, string hint, superButtonType type)
    {
        this.response = response;

        this.hint = hint;

        this.type = type;
    }
Пример #3
0
    public void setTexture(superButtonType type)
    {
        switch (type)
        {
        case superButtonType.act:
            UITextureInButton.mainTexture = act;
            break;

        case superButtonType.attack:
            UITextureInButton.mainTexture = attack;
            break;

        case superButtonType.bp:
            UITextureInButton.mainTexture = bp;
            break;

        case superButtonType.change:
            UITextureInButton.mainTexture = change;
            break;

        case superButtonType.ep:
            UITextureInButton.mainTexture = ep;
            break;

        case superButtonType.mp:
            UITextureInButton.mainTexture = mp;
            break;

        case superButtonType.no:
            UITextureInButton.mainTexture = no;
            break;

        case superButtonType.see:
            UITextureInButton.mainTexture = see;
            break;

        case superButtonType.set:
            UITextureInButton.mainTexture = set;
            break;

        case superButtonType.spsummon:
            UITextureInButton.mainTexture = spsummon;
            break;

        case superButtonType.summon:
            UITextureInButton.mainTexture = summon;
            break;

        case superButtonType.yes:
            UITextureInButton.mainTexture = yes;
            break;
        }
        Color c;

        ColorUtility.TryParseHtmlString(Config.Getui("gameButtonSign.color"), out c);
        UITextureInButton.color = c;
    }