Esempio n. 1
0
        public override void ProcessLogic(PropertyMessage evt)
        {
            switch (evt.PropertyName)
            {
            case "ringUp":
                if (evt.OldValue == evt.NewValue)
                {
                    return;
                }
                Debug.Log("ringUp" + ":" + evt.NewValue);
                _communicationEntity.isCanRingUp   = false;
                _communicationEntity.isCellStandby = true;
                break;

            case "cellStandby":
                if (evt.OldValue == evt.NewValue)
                {
                    return;
                }
                _communicationEntity.isCellStandby = false;
                Debug.Log("cellStandby" + ":" + evt.NewValue);
                ClosePhone();
                break;

            case "isCanRingUp":
                Debug.Log("cellStandby" + ":" + evt.NewValue);
                bool active = (bool)evt.NewValue;
                GameObject.Find("RingUp").GetComponent <Button>().interactable = active;
                break;

            case "isCellStandby":
                Debug.Log("cellStandby" + ":" + evt.NewValue);
                active = (bool)evt.NewValue;
                GameObject.Find("CellStandby").GetComponent <Button>().interactable = active;
                break;

            case "phoneNumber":
                Debug.Log("cellStandby" + ":" + evt.NewValue);
                if (!string.IsNullOrEmpty(evt.NewValue.ToString()))
                {
                    //当前是否在服务区
                    IphoneEntity entity = (IphoneEntity)GameObject.Find("ball1").GetComponent <IphoneModel>().DataEntity;
                    if (entity.areaID != -1)
                    {
                        _communicationEntity.isCanRingUp = true;
                    }
                    else
                    {
                        _communicationEntity.isCanRingUp = false;
                    }
                }
                else
                {
                    _communicationEntity.isCanRingUp = false;
                }
                break;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 初始化
 /// </summary>
 private void Start()
 {
     iphoneModel  = GetComponent <IphoneModel>();
     iphoneEntity = (IphoneEntity)iphoneModel.DataEntity;
 }