void OnUpdatePropCount()
        {
            int index = 0;
            int off   = Character.dataModel.propCount - _propStats.Count;

            if (off > 0)
            {
                GameObject prefab = Manage.Instance.Resources.GetObj <GameObject>(ResourcesEnum.UIPrefab, Config.PropStatsGame, true);
                for (index = 0; index < off; index++)
                {
                    PropStatsGame p = NetStatsGame(_PropParent);
                    p.OnInit(OnClickProp, index);
                    _propStats.Add(p);
                }
            }
            index = 0;
            for (int i = 0; i < Character.dataModel.propCount; i++, index++)
            {
                BaseAdditionalAttribute _att = Manage.Instance.Data.GetBaseProp(Character.dataModel.prop[i]);
                _propStats[i].Attribute = _att;
            }
            for (int i = index; i < _propStats.Count; i++)
            {
                _propStats[i].gameObject.SetActive(false);
            }
        }
        public override void mAwake()
        {
            base.mAwake();
            _dataStats.Clear();
            _attributeStats.Clear();
            _skillStats.Clear();
            _resistanceStats.Clear();


            GameObject prefab = Manage.Instance.Resources.GetObj <GameObject>(ResourcesEnum.UIPrefab, Config.AttributeStatsGame, true);

            StartAttributeStats("attribute", 1, prefab, (int)AttributeEnum.length, ref _attributeStats);
            StartAttributeStats("skill", 2, prefab, (int)skillEnum.length, ref _skillStats);
            //距离和攻击有最大最小
            StartAttributeStats("data", 3, prefab, (int)DataEnum.showLength, ref _dataStats);
            StartAttributeStats("resistance", 4, prefab, (int)ResistanceEnum.length, ref _resistanceStats);


            Transform EquipmentParent = transform.Find("Left/Equipment/Grid");

            _equipmentStats = new PropStatsGame[EquipmentParent.childCount];
            for (int i = 0; i < _equipmentStats.Length; i++)
            {
                PropStatsGame p = NetStatsGame(EquipmentParent);
                p.gameObject.name = ((EquipmentEnum)i).ToString();
                p.OnInit(OnClickEquipment, i);
                _equipmentStats[i] = p;
            }
            _PropParent = transform.Find("Left/Prop/Grid");
        }
Ejemplo n.º 3
0
        void UpdateStatsGame(PropStatsGame statsGame, GameNumber prop)
        {
            BaseAdditionalAttribute attribute = Manage.Instance.Data.GetBaseProp(prop);

            if (attribute != null)
            {
                attribute.number = prop.number;
            }
            statsGame.Attribute = attribute;
        }
Ejemplo n.º 4
0
        public override void mAwake()
        {
            base.mAwake();
            transform.Find("Upper/close").GetComponent <Button>().onClick.AddListener(Close);
            Transform  parent = transform.Find("Middle/Grid");
            GameObject prefab = Manage.Instance.Resources.GetObj <GameObject>(ResourcesEnum.UIPrefab, Config.PropStatsGame, true);

            StatsGameAry = new PropStatsGame[Config.BackPackCount];
            for (int i = 0; i < StatsGameAry.Length; i++)
            {
                PropStatsGame game = Instantiate <GameObject>(prefab).AddComponent <PropStatsGame>();
                game.transform.SetParent(parent, false);
                game.transform.localScale = Vector3.one;
                game.OnInit(ClickPropGame, i);
                StatsGameAry[i] = game;
            }

            moneyText = transform.Find("Lower/money").GetComponent <Text>();
            transform.Find("Lower/Arrangement").GetComponent <Button>().onClick.AddListener(Arrangement);
        }
Ejemplo n.º 5
0
        void UpdateStatsGame(PropStatsGame statsGame, GameNumber prop)
        {
            BaseAdditionalAttribute attribute = null;

            switch ((AdditionalAttributeEnum)prop.PropType)
            {
            case AdditionalAttributeEnum.equipment:
                attribute =
                    Manage.Instance.Data.GetObj <EquipmentAttribute>(prop.id);
                break;

            case AdditionalAttributeEnum.prop:
                attribute =
                    Manage.Instance.Data.GetObj <PropAttribute>(prop.id);
                break;
            }
            if (attribute != null)
            {
                attribute.number = prop.number;
            }
            statsGame.Attribute = attribute;
        }
Ejemplo n.º 6
0
        public override void mAwake()
        {
            base.mAwake();
            addition = new BaseAdditionalAttribute
                       [
                Manage.Instance.Data.GetDictionary <PropAttribute>().Count +
                Manage.Instance.Data.GetDictionary <EquipmentAttribute>().Count
                       ];
            int index = 0;

            for (int i = 0; i < Manage.Instance.Data.GetDictionary <PropAttribute>().Count; i++)
            {
                addition[index]        = Manage.Instance.Data.GetDictionary <PropAttribute>().Values.ToList()[i] as BaseAdditionalAttribute;
                addition[index].number = index + 1;
                index++;
            }
            for (int i = 0; i < Manage.Instance.Data.GetDictionary <EquipmentAttribute>().Count; i++)
            {
                addition[index]        = Manage.Instance.Data.GetDictionary <EquipmentAttribute>().Values.ToList()[i] as BaseAdditionalAttribute;
                addition[index].number = 1;
                index++;
            }



            StatsGameAry = new PropStatsGame[addition.Length];
            Transform  parent = transform.Find("Middle/Grid");
            GameObject prefab = Manage.Instance.Resources.GetObj <GameObject>(ResourcesEnum.UIPrefab, Config.PropStatsGame, true);

            for (int i = 0; i < StatsGameAry.Length; i++)
            {
                PropStatsGame game = Instantiate <GameObject>(prefab).AddComponent <PropStatsGame>();
                game.transform.SetParent(parent, false);
                game.transform.localScale = Vector3.one;
                game.OnInit(ClickPropGame, i);
                StatsGameAry[i] = game;
            }
        }