Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 protected static void SetMessage(UIButtonMessage message, bool messageEnabled)
 {
     if (message != null)
     {
         message.enabled = messageEnabled;
     }
 }
Ejemplo n.º 2
0
        private void _init()
        {
            this._isControl  = false;
            this._isFinished = false;
            this._nAreaId    = 1;
            this._nMapId     = 1;
            this._openMapIDs = null;
            Util.FindParentToChild <UITexture>(ref this._uiMapImage, base.get_transform(), "MapImage");
            Util.FindParentToChild <UITexture>(ref this._uiMapOld, base.get_transform(), "MapImageOld");
            Util.FindParentToChild <UISprite>(ref this._uiMapIcon, base.get_transform(), "MapIcon");
            Util.FindParentToChild <UITexture>(ref this._uiText, base.get_transform(), "Text");
            Util.FindParentToChild <UISprite>(ref this._uiNextIcon, base.get_transform(), "NextIcon");
            Util.FindParentToChild <ParticleSystem>(ref this._uiLightPar, base.get_transform(), "Light1");
            Util.FindParentToChild <ParticleSystem>(ref this._uiBackLightPar, base.get_transform(), "BackLight");
            if (this._anime == null)
            {
                this._anime = base.GetComponent <Animation>();
            }
            if (this._gearAnime == null)
            {
                this._gearAnime = this._uiNextIcon.GetComponent <Animation>();
            }
            this._uiBackLightPar.SetActive(false);
            this._uiNextIcon.alpha = 0f;
            this._anime.Stop();
            this._gearAnime.Stop();
            UIButtonMessage component = this._uiNextIcon.GetComponent <UIButtonMessage>();

            component.target       = base.get_gameObject();
            component.functionName = "_nextIconEL";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
        }
Ejemplo n.º 3
0
        public void _init_repair()
        {
            this._isBtnMaruUp                     = false;
            this.rep                              = GameObject.Find("Repair Root").GetComponent <repair>();
            this.bd1                              = GameObject.Find("board").GetComponent <board>();
            this.bd2                              = GameObject.Find("board2").GetComponent <board2>();
            this.dockSelectController             = new KeyControl(0, 1, 0.4f, 0.1f);
            this.dockSelectController.isLoopIndex = false;
            this.dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            iTween.ScaleTo(base.get_gameObject(), new Vector3(0.6f, 0.6f, 0.6f), 0f);
            this._Button_Yes3      = GameObject.Find("dialog3_top/dialog3/btn_yes").GetComponent <UIButton>();
            this._Button_No3       = GameObject.Find("dialog3_top/dialog3/btn_no").GetComponent <UIButton>();
            this.btn_obj[0]        = this._Button_No3.get_gameObject();
            this.btn_obj[1]        = this._Button_Yes3.get_gameObject();
            this._uiOverlayButton3 = GameObject.Find("dialog3_top/dialog3/OverlayBtn3").GetComponent <UIButton>();
            EventDelegate.Add(this._uiOverlayButton3.onClick, new EventDelegate.Callback(this._onClickOverlayButton3));
            UIButtonMessage component = this._Button_Yes3.GetComponent <UIButtonMessage>();

            component.target       = base.get_gameObject();
            component.functionName = "Pressed_Button_Yes3";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = this._Button_No3.GetComponent <UIButtonMessage>();

            component2.target       = base.get_gameObject();
            component2.functionName = "Pressed_Button_No3";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            this.Set_Button_Sprite(true);
            this._clickmask = GameObject.Find("click_mask").GetComponent <repair_clickmask>();
            this._bVector   = Vector3.get_one();
        }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     // ルートの設定
     FieldRoot      = GameObject.FindGameObjectWithTag("FieldRoot");
     Message        = GetComponent <UIButtonMessage> ();
     Message.target = FieldRoot;
 }
Ejemplo n.º 5
0
        private void _init()
        {
            _isControl  = false;
            _isFinished = false;
            _nAreaId    = 1;
            _nMapId     = 1;
            _openMapIDs = null;
            Util.FindParentToChild(ref _uiMapImage, base.transform, "MapImage");
            Util.FindParentToChild(ref _uiMapOld, base.transform, "MapImageOld");
            Util.FindParentToChild(ref _uiMapIcon, base.transform, "MapIcon");
            Util.FindParentToChild(ref _uiText, base.transform, "Text");
            Util.FindParentToChild(ref _uiNextIcon, base.transform, "NextIcon");
            Util.FindParentToChild <ParticleSystem>(ref _uiLightPar, base.transform, "Light1");
            Util.FindParentToChild <ParticleSystem>(ref _uiBackLightPar, base.transform, "BackLight");
            if ((UnityEngine.Object)_anime == null)
            {
                _anime = GetComponent <Animation>();
            }
            if ((UnityEngine.Object)_gearAnime == null)
            {
                _gearAnime = _uiNextIcon.GetComponent <Animation>();
            }
            ((Component)_uiBackLightPar).SetActive(isActive: false);
            _uiNextIcon.alpha = 0f;
            _anime.Stop();
            _gearAnime.Stop();
            UIButtonMessage component = _uiNextIcon.GetComponent <UIButtonMessage>();

            component.target       = base.gameObject;
            component.functionName = "_nextIconEL";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
        }
Ejemplo n.º 6
0
        protected virtual void init()
        {
            Util.FindParentToChild(ref _uiBg, base.transform, "BG");
            Util.FindParentToChild(ref _uiShip, base.transform, "ShipLayoutOffset/Ship");
            Util.FindParentToChild(ref _clsShipName, base.transform, "MessageWindow/ShipName");
            Util.FindParentToChild(ref _clsSType, base.transform, "MessageWindow/ShipType");
            Util.FindParentToChild <Animation>(ref _getIconAnim, base.transform, "MessageWindow/Get");
            Util.FindParentToChild(ref _uiGear, base.transform, "MessageWindow/NextBtn");
            if ((UnityEngine.Object)_anim == null)
            {
                _anim = GetComponent <Animation>();
            }
            if ((UnityEngine.Object)_gearAnim == null)
            {
                _gearAnim = _uiGear.GetComponent <Animation>();
            }
            _clsShipMessage = new Generics.Message(base.transform, "MessageWindow/ShipMessage");
            _uiShip.alpha   = 0f;
            UIButtonMessage component = _uiGear.GetComponent <UIButtonMessage>();

            component.target       = base.gameObject;
            component.functionName = "prodReceiveShipEL";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = _uiBg.GetComponent <UIButtonMessage>();

            component2.target       = base.gameObject;
            component2.functionName = "backgroundEL";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            _isInput    = false;
            _isFinished = false;
            debugIndex  = 0;
            _uiGear.GetComponent <Collider2D>().enabled = false;
        }
Ejemplo n.º 7
0
 private void OnDestroy()
 {
     mKeyController = null;
     TweenPos       = null;
     SortButton     = null;
     BackButton     = null;
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     ButtonMes              = shipSprite.GetComponent <UIButtonMessage>();
     ButtonMes.target       = base.gameObject;
     ButtonMes.functionName = "OnIconTouch";
     setColliderEnable(isEnable: false);
 }
Ejemplo n.º 9
0
        public void _init_repair()
        {
            _isBtnMaruUp                     = false;
            rep                              = GameObject.Find("Repair Root").GetComponent <repair>();
            bd1                              = GameObject.Find("board1_top/board").GetComponent <board>();
            bd2                              = GameObject.Find("board2").GetComponent <board2>();
            csb                              = GameObject.Find("dialog2_top/dialog2/Banner/CommonShipBanner2").GetComponent <CommonShipBanner>();
            dockSelectController             = new KeyControl(0, 1);
            dockSelectController.isLoopIndex = false;
            dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            iTween.ScaleTo(base.gameObject, new Vector3(0.6f, 0.6f, 0.6f), 0f);
            _Button_Yes2      = GameObject.Find("dialog2_top/dialog2/btn_yes").GetComponent <UIButton>();
            _Button_No2       = GameObject.Find("dialog2_top/dialog2/btn_no").GetComponent <UIButton>();
            btn_obj[0]        = _Button_No2.gameObject;
            btn_obj[1]        = _Button_Yes2.gameObject;
            _uiOverlayButton2 = GameObject.Find("dialog2_top/dialog2/OverlayBtn2").GetComponent <UIButton>();
            EventDelegate.Add(_uiOverlayButton2.onClick, _onClickOverlayButton2);
            UIButtonMessage component = _Button_Yes2.GetComponent <UIButtonMessage>();

            component.target       = base.gameObject;
            component.functionName = "Pressed_Button_Yes2";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = _Button_No2.GetComponent <UIButtonMessage>();

            component2.target       = base.gameObject;
            component2.functionName = "Pressed_Button_No2";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            Set_Button_Sprite(value: true);
            _clickmask = GameObject.Find("click_mask").GetComponent <repair_clickmask>();
            _bVector   = Vector3.one;
        }
Ejemplo n.º 10
0
    private void CreateList(int type)
    {
        GameObject parent = GridNormal;

        if (type == GRID_ACTIVITY)
        {
            parent = GridActivity;
        }
        else if (type == GRID_ELITE)
        {
            parent = GridElite;
        }

        for (int i = 0; i < 10; i++)
        {
            GameObject newItem = (GameObject)Instantiate(dungeonListItem);
            newItem.transform.parent     = parent.transform;
            newItem.transform.position   = new Vector3(0, 0, 0);
            newItem.transform.localScale = new Vector3(1, 1, 1);
            UILabel label = newItem.transform.FindChild("Label").GetComponent <UILabel>();
            label.text = temporaryscenename[i];
            UIButtonMessage loadmsg = newItem.GetComponent <UIButtonMessage>();
            loadmsg.target       = loadtarget;
            loadmsg.functionName = "LoadBattleUIScene";
        }
        parent.GetComponent <UIGrid>().repositionNow = true;
    }
Ejemplo n.º 11
0
 private void Awake()
 {
     this.ButtonMes              = this.shipSprite.GetComponent <UIButtonMessage>();
     this.ButtonMes.target       = base.get_gameObject();
     this.ButtonMes.functionName = "OnIconTouch";
     this.setColliderEnable(false);
 }
Ejemplo n.º 12
0
    void AddBox(List <Vector3> boxlist, List <Vector3> boxposlist, List <string> newstrlist)
    {
        for (int i = 0; i < boxlist.Count; i++)
        {
            Object prefab = PrefabLoader.loadFromPack("LS/Urlobj");
            if (prefab != null)
            {
                GameObject obj = Instantiate(prefab) as GameObject;
                RED.AddChild(obj, root);

                UILabel label = obj.GetComponentInChildren <UILabel>();
                label.text = "[00FF00]" + newstrlist[i];
                obj.transform.localPosition = boxposlist[i];

                obj.AddComponent <UIButton>().tweenTarget = label.gameObject;

                BoxCollider box = obj.gameObject.AddComponent <BoxCollider>();
                box.size   = new Vector3((float)label.width, (float)label.height, 0f);
                box.center = new Vector3((float)label.width / 2, 0f, 0f);

                UIButtonMessage message = obj.gameObject.AddComponent <UIButtonMessage>();
                message.target       = this.gameObject;
                message.functionName = "OnClick";
                message.trigger      = UIButtonMessage.Trigger.OnClick;
            }
        }
    }
Ejemplo n.º 13
0
        private void Dock_not_found()
        {
            if (this._HOLT_DIALOG)
            {
                return;
            }
            GameObject.Find("Repair_BGS/trusses").get_transform().set_localScale(Vector3.get_zero());
            GameObject.Find("Repair_BGS/BG Panel2/bg_cr03").get_transform().set_localScale(Vector3.get_zero());
            GameObject.Find("board1_top/header").get_transform().set_localScale(Vector3.get_zero());
            UIButton        component  = GameObject.Find("info/Button").GetComponent <UIButton>();
            UIButtonMessage component2 = component.GetComponent <UIButtonMessage>();

            component2.target       = base.get_gameObject();
            component2.functionName = "Pressed_Button_Back";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            iTween.MoveTo(GameObject.Find("info/docknotfound"), iTween.Hash(new object[]
            {
                "islocal",
                true,
                "x",
                0f,
                "time",
                2f,
                "easetype",
                iTween.EaseType.easeOutElastic
            }));
            this._HOLT_DIALOG = true;
        }
Ejemplo n.º 14
0
    ///<summary>
    /// Reset the dice roll list and the physics on the dice
    ///</summary>
    void ResetDice()
    {
        dice4Roll.Clear();
        int        count      = 0;
        GameObject startPivot = GameObject.Find("StartPivotPoint");
        Vector3    pos        = startPivot.transform.position;

        foreach (Die die in myDice)
        {
            UIButtonMessage uimsg = die.GetComponent <UIButtonMessage> ();
            if (uimsg != null)
            {
                uimsg.target       = this.gameObject;
                uimsg.functionName = "OnDiePressed";
            }
            dice4Roll.Add(die);
            die.tag = "Untagged";
            // dieOnFloat( die.gameObject, count );  // put back position
            die.gameObject.rigidbody.useGravity  = true;             // drop to the table
            die.gameObject.rigidbody.isKinematic = true;             // drop to the table
            die.transform.position = new Vector3(pos.x + 0.3f * count, pos.y, pos.z);
            count++;
        }

        ClearHolders();
    }
Ejemplo n.º 15
0
        public void _init_repair()
        {
            this.rep              = GameObject.Find("Repair Root").GetComponent <repair>();
            this.csb              = GameObject.Find("dialog_top/dialog/Banner/CommonShipBanner2").GetComponent <CommonShipBanner>();
            this.bd3              = GameObject.Find("board3_top/board3").GetComponent <board3>();
            this._Button_Yes      = GameObject.Find("dialog_top/dialog/btn_yes").GetComponent <UIButton>();
            this._Button_No       = GameObject.Find("dialog_top/dialog/btn_no").GetComponent <UIButton>();
            this.btn_obj[0]       = this._Button_No.get_gameObject();
            this.btn_obj[1]       = this._Button_Yes.get_gameObject();
            this._uiOverlayButton = GameObject.Find("dialog_top/dialog/OverlayBtn").GetComponent <UIButton>();
            EventDelegate.Add(this._uiOverlayButton.onClick, new EventDelegate.Callback(this._onClickOverlayButton));
            UIButtonMessage component = this._Button_Yes.GetComponent <UIButtonMessage>();

            component.target       = base.get_gameObject();
            component.functionName = "Pressed_Button_Yes";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = this._Button_No.GetComponent <UIButtonMessage>();

            component2.target                     = base.get_gameObject();
            component2.functionName               = "Pressed_Button_No";
            component2.trigger                    = UIButtonMessage.Trigger.OnClick;
            this._clsRepair                       = this.rep.now_clsRepair();
            this.dockSelectController             = new KeyControl(0, 1, 0.4f, 0.1f);
            this.dockSelectController.isLoopIndex = false;
            this.dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            this.sw = GameObject.Find("sw01").GetComponent <sw>();
            this.sw.setSW(false);
            this._bVector = Vector3.get_one();
        }
Ejemplo n.º 16
0
    void Start()
    {
        UIButtonMessage btnMsg = GetComponent <UIButtonMessage>();

        btnMsg.target       = UIMessageMain.Instance.gameObject;
        btnMsg.functionName = "HideEmotionAndQuickUI";
    }
 private void OnDestroy()
 {
     this.mKeyController = null;
     this.TweenPos       = null;
     this.SortButton     = null;
     this.BackButton     = null;
 }
Ejemplo n.º 18
0
    //割り当てる(一括)
    public Dictionary <GameObject, int> GetMarker(List <Vector3> posList, GameObject target, string functionName, float z = 0f)
    {
        var gDic = new Dictionary <GameObject, int>();
        int j    = 0;

        for (int i = 0; i < posList.Count; i++)
        {
            UIButtonMessage g = null;
            for (; j < prefabPool.Count; j++)
            {
                if (!prefabPool[j].gameObject.activeInHierarchy)
                {
                    g = prefabPool[j];
                    break;
                }
            }
            if (g)
            {
                g.gameObject.SetActive(true);
                g.transform.localScale = Vector3.one;
                var pos = FuncBox.ViewPointTransform(worldCamera, posList[i], uiCamera);
                pos.z = z;
                g.transform.position = pos;
                g.target             = target;
                g.functionName       = functionName;

                gDic.Add(g.gameObject, i);
            }
        }

        return(gDic);
    }
Ejemplo n.º 19
0
    public void ResetMenuButtonClickEvent(bool started)
    {
        UICheckbox[] check_boxs = mMenuItemRoot.GetComponentsInChildren <UICheckbox>(true);

        if (started)
        {
            foreach (UICheckbox check_box in check_boxs)
            {
                if (check_box.startsChecked)
                {
                    UIButtonMessage mgs = check_box.gameObject.GetComponent <UIButtonMessage>();
                    Invoke(mgs.functionName, 0.0f);
                    break;
                }
            }
        }
        else
        {
            foreach (UICheckbox check_box in check_boxs)
            {
                if (check_box.isChecked)
                {
                    UIButtonMessage mgs = check_box.gameObject.GetComponent <UIButtonMessage>();
                    Invoke(mgs.functionName, 0.0f);

                    break;
                }
            }
        }
    }
Ejemplo n.º 20
0
        protected virtual void init()
        {
            Util.FindParentToChild <UITexture>(ref this._uiBg, base.get_transform(), "BG");
            Util.FindParentToChild <UITexture>(ref this._uiShip, base.get_transform(), "ShipLayoutOffset/Ship");
            Util.FindParentToChild <UILabel>(ref this._clsShipName, base.get_transform(), "MessageWindow/ShipName");
            Util.FindParentToChild <UILabel>(ref this._clsSType, base.get_transform(), "MessageWindow/ShipType");
            Util.FindParentToChild <Animation>(ref this._getIconAnim, base.get_transform(), "MessageWindow/Get");
            Util.FindParentToChild <UISprite>(ref this._uiGear, base.get_transform(), "MessageWindow/NextBtn");
            if (this._anim == null)
            {
                this._anim = base.GetComponent <Animation>();
            }
            if (this._gearAnim == null)
            {
                this._gearAnim = this._uiGear.GetComponent <Animation>();
            }
            this._clsShipMessage = new Generics.Message(base.get_transform(), "MessageWindow/ShipMessage");
            this._uiShip.alpha   = 0f;
            UIButtonMessage component = this._uiGear.GetComponent <UIButtonMessage>();

            component.target       = base.get_gameObject();
            component.functionName = "prodReceiveShipEL";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = this._uiBg.GetComponent <UIButtonMessage>();

            component2.target       = base.get_gameObject();
            component2.functionName = "backgroundEL";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            this._isInput           = false;
            this._isFinished        = false;
            this.debugIndex         = 0;
            this._uiGear.GetComponent <Collider2D>().set_enabled(false);
        }
Ejemplo n.º 21
0
        public void _init_repair()
        {
            rep              = GameObject.Find("Repair Root").GetComponent <repair>();
            csb              = GameObject.Find("dialog_top/dialog/Banner/CommonShipBanner2").GetComponent <CommonShipBanner>();
            bd3              = GameObject.Find("board3_top/board3").GetComponent <board3>();
            _Button_Yes      = GameObject.Find("dialog_top/dialog/btn_yes").GetComponent <UIButton>();
            _Button_No       = GameObject.Find("dialog_top/dialog/btn_no").GetComponent <UIButton>();
            btn_obj[0]       = _Button_No.gameObject;
            btn_obj[1]       = _Button_Yes.gameObject;
            _uiOverlayButton = GameObject.Find("dialog_top/dialog/OverlayBtn").GetComponent <UIButton>();
            EventDelegate.Add(_uiOverlayButton.onClick, _onClickOverlayButton);
            UIButtonMessage component = _Button_Yes.GetComponent <UIButtonMessage>();

            component.target       = base.gameObject;
            component.functionName = "Pressed_Button_Yes";
            component.trigger      = UIButtonMessage.Trigger.OnClick;
            UIButtonMessage component2 = _Button_No.GetComponent <UIButtonMessage>();

            component2.target       = base.gameObject;
            component2.functionName = "Pressed_Button_No";
            component2.trigger      = UIButtonMessage.Trigger.OnClick;
            _clsRepair                       = rep.now_clsRepair();
            dockSelectController             = new KeyControl(0, 1);
            dockSelectController.isLoopIndex = false;
            dockSelectController.setChangeValue(0f, 1f, 0f, -1f);
            sw = GameObject.Find("sw01").GetComponent <sw>();
            sw.setSW(stat: false);
            _bVector = Vector3.one;
        }
Ejemplo n.º 22
0
    public static void AvailableBtn(GameObject obj, GameObject target, string functionName)
    {
        if (obj == null)
        {
            return;
        }
        obj.SetActive(true);
        if (!target || string.IsNullOrEmpty(functionName))
        {
            return;
        }
        UIButton uiBtn = obj.GetComponent <UIButton>();

        if (uiBtn)
        {
            uiBtn.defaultColor = uiBtn.hover = Color.white;
            if (!uiBtn.isEnabled)
            {
                uiBtn.isEnabled = true;
            }
            else
            {
                uiBtn.UpdateColor(true);
            }
        }

        UIButtonMessage btnMsg = obj.GetComponent <UIButtonMessage>();

        btnMsg.target       = target;
        btnMsg.functionName = functionName;
    }
Ejemplo n.º 23
0
    public void SetData(NewMapFinalTrial m_NewMapFinalTrial)
    {
        if (m_NewMapFinalTrial == null)
        {
            return;
        }
        mGuang.gameObject.SetActive(false);
        mNewMapFinalTrial = m_NewMapFinalTrial;

        Spr_Buliding.pivot      = UIWidget.Pivot.Bottom;
        transform.localPosition = m_NewMapFinalTrial.localPosition;

        Spr_Buliding.spriteName = m_NewMapFinalTrial.Data.TextrueID;
        Spr_Buliding.MakePixelPerfect();
//		ChangeScale();
        UIButtonMessage message = gameObject.AddComponent <UIButtonMessage>();

        if (message != null)
        {
            message.target       = FinalTrialMgr.GetInstance().m_PvpShaluBuouRoot.m_UIMapOfFinalTrial.gameObject;
            message.functionName = "OnClickBuild";
        }

        stars.SetStar(0);

        SetBuildingState(m_NewMapFinalTrial);
    }
Ejemplo n.º 24
0
        private void OnButtonMessage(UIButtonMessage message)
        {
            if (OutputSockets == null || OutputSockets.Count == 0)
            {
                return;
            }

            UIConnectionTrigger trigger;

            switch (message.Type)
            {
            case UIButtonBehaviorType.OnClick:
                trigger = UIConnectionTrigger.ButtonClick;
                break;

            case UIButtonBehaviorType.OnDoubleClick:
                trigger = UIConnectionTrigger.ButtonDoubleClick;
                break;

            case UIButtonBehaviorType.OnLongClick:
                trigger = UIConnectionTrigger.ButtonLongClick;
                break;

            case UIButtonBehaviorType.OnRightClick:
            case UIButtonBehaviorType.OnPointerEnter:
            case UIButtonBehaviorType.OnPointerExit:
            case UIButtonBehaviorType.OnPointerDown:
            case UIButtonBehaviorType.OnPointerUp:
            case UIButtonBehaviorType.OnSelected:
            case UIButtonBehaviorType.OnDeselected:
            case UIButtonBehaviorType.OnBeginDrag:
            case UIButtonBehaviorType.OnDrag:
            case UIButtonBehaviorType.OnEndDrag:
            case UIButtonBehaviorType.OnDragOver:
            case UIButtonBehaviorType.OnDrop:
                return;

            default: throw new ArgumentOutOfRangeException();
            }

            foreach (Socket socket in OutputSockets)
            {
                if (!socket.IsConnected)
                {
                    continue;
                }
                UIConnection value = UIConnection.GetValue(socket);
                if (value.Trigger != trigger)
                {
                    continue;
                }
                if (!value.ButtonName.Equals(message.Button != null ? message.Button.ButtonName : message.ButtonName))
                {
                    continue;
                }
                ActivateOutputSocketInputNode(socket);
                break;
            }
        }
Ejemplo n.º 25
0
 public void AddEventListener(UIButtonMessage.Trigger type, string func, GameObject obj, string s)
 {
     m_UIButtonMessage                 = m_Entity.AddComponent <UIButtonMessage>();
     m_UIButtonMessage.trigger         = type;
     m_UIButtonMessage.functionName    = func;
     m_UIButtonMessage.target          = obj;
     m_UIButtonMessage.parameterString = s;
 }
Ejemplo n.º 26
0
 private void Start()
 {
     m_OnButtonClick = gameObject.AddComponent <UIButtonMessage> ();
     m_OnButtonClick.target = gameObject;
     m_OnButtonClick.trigger = UIButtonMessage.Trigger.OnClick;
     m_OnButtonClick.functionName = "ButtonClickAction";
     m_OnButtonClick.includeChildren = false;
 }
Ejemplo n.º 27
0
    void Start()
    {
        m_btnButton = Util.FindCo <UIButtonMessage>(gameObject, "Button");

        m_lbLabel = Util.FindCo <UILabel>(gameObject, "Label");

        UIEventListener.Get(m_btnButton.gameObject).onClick += OnClickButton;
    }
Ejemplo n.º 28
0
 private void OnUIButtonMessage(UIButtonMessage message)
 {
     if (message.Type != UIButtonBehaviorType.OnClick)
     {
         return;
     }
     DispatchEvent(message.ButtonName);
 }
        private void setButtonMessage(GameObject obj, string name)
        {
            UIButtonMessage component = obj.GetComponent <UIButtonMessage>();

            component.target       = base.get_gameObject();
            component.functionName = name;
            component.trigger      = UIButtonMessage.Trigger.OnClick;
        }
Ejemplo n.º 30
0
 private void RemoveEventListener()
 {
     if (m_UIButtonMessage)
     {
         Destroy(m_UIButtonMessage);
         m_UIButtonMessage = null;
     }
 }
        private void setButtonMsg(UIButton obj, GameObject targetObj, string functionName)
        {
            UIButtonMessage component = obj.GetComponent <UIButtonMessage>();

            component.target       = targetObj;
            component.functionName = functionName;
            component.trigger      = UIButtonMessage.Trigger.OnClick;
        }
        private void Start()
        {
            m_OnButtonPress = gameObject.AddComponent <UIButtonMessage> ();
            m_OnButtonPress.target = gameObject;
            m_OnButtonPress.trigger = UIButtonMessage.Trigger.OnPress;
            m_OnButtonPress.functionName = "OnButtonPress";
            m_OnButtonPress.includeChildren = false;

            m_OnButtonRelease = gameObject.AddComponent <UIButtonMessage> ();
            m_OnButtonRelease.target = gameObject;
            m_OnButtonRelease.trigger = UIButtonMessage.Trigger.OnRelease;
            m_OnButtonRelease.functionName = "OnButtonRelease";
            m_OnButtonRelease.includeChildren = false;

            enabled = false;
        }