Exemplo n.º 1
0
    //public virtual NodeComponent Init (ItemNodeData item_node_data)
    //{
    //    _ItemNodeData = item_node_data;
    //    _IndexId      = GetInstanceID ();

    //    return this;
    //}

    public virtual NodeComponent Init(CarDataProperties item_node_data)
    {
        _ItemData = item_node_data;
        _IndexId  = GetInstanceID();

        return(this);
    }
Exemplo n.º 2
0
    public override NodeComponent Init(CarDataProperties _item_node_data)
    {
        if (ReferenceEquals(BoxTransform, null))
        {
            BoxTransform = gameObject.transform;
        }

        _ItemData = _item_node_data;
        _IndexId  = GetInstanceID();

        sprite_renderer.enabled = true;

        int _weaponLevel = _item_node_data.Level;

        if (_weaponLevel > 30)
        {
            _weaponLevel -= 30;
        }

        weapon_behaviour.Init(_item_node_data, TagEnums.GetKey(TagEnums.TagId.Enemy));

        SetStatePause(true);

        weapon_behaviour.OnShooter = WeaponBehaviourOnOnShooter;

        RefreshLevel();

        _spriteRenderers = GetComponentsInChildren <SpriteRenderer>();

        return(this);
    }
Exemplo n.º 3
0
    public override NodeComponent Init(CarDataProperties item_node_data)
    {
        base.Init(item_node_data);

        SetZoom(_YRow != 0);
        return(this);
    }
Exemplo n.º 4
0
    public void UnRegisterData(CarDataProperties data)
    {
        for (int i = 0; i < _DataInMining.Count; i++)
        {
            if (_DataInMining[i].Level != data.Level)
            {
                continue;
            }

            _DataInMining.RemoveAt(i);

            double profit = data.ProfitPerSec;
            var    unit   = data.ProfitPerSecUnit;

            profit = profit * Mathf.Pow(data.ProfitPerUpgradeCoefficient, PlayerData.GetNumberUpgradeItemProfitCoefficient(data.Level));

            Helper.FixUnit(ref profit, ref unit);

            Helper.MinusValue(_ProfitPerSec, _ProfitUnit, profit, unit, out _ProfitPerSec, out _ProfitUnit);

            _RealProfitUnit   = _ProfitUnit;
            _RealProfitPerSec = _ProfitPerSec;

            GetRealEarning(ref _RealProfitPerSec, ref _RealProfitUnit);

            break;
        }
    }
Exemplo n.º 5
0
    public override NodeComponent Init(CarDataProperties _item_node_data)
    {
        //   _ItemNodeData = _item_node_data;
        _IndexId = GetInstanceID();

        SetStatePause(true);

        return(this);
    }
Exemplo n.º 6
0
        public void ShowView(CarDataProperties _unlockCarProperties, Sprite rewardCarSprite, int RewardAmount)
        {
            ObscuredInt nameLevel = _unlockCarProperties.Level > 30? (ObscuredInt)(_unlockCarProperties.Level.GetDecrypted() - 30) : _unlockCarProperties.Level;

            CarName.text         = ApplicationLanguage.GetItemName(nameLevel);
            CarLevel.text        = string.Format("Lv." + _unlockCarProperties.Level);
            CarImage.sprite      = _unlockCarProperties.Icon;
            Earning.fillAmount   = _unlockCarProperties.VEarning;
            Timing.fillAmount    = _unlockCarProperties.VSpeed;
            Damage.fillAmount    = _unlockCarProperties.VDamage;
            RewardCarIcon.sprite = rewardCarSprite;
            RewardCarAmount.text = string.Format("+" + RewardAmount);
        }
Exemplo n.º 7
0
    public void InstanceBullets(int level, CarDataProperties _carDataProperties, int level_weapon, Vector3 position_start, string tag_enemy, Vector3 angle)
    {
        var data    = GameData.Instance.BulletsData.GetBullets(level);
        var bullets = PoolExtension.GetPool(data.BulletId, false);

        if (ReferenceEquals(bullets, null))
        {
            return;
        }

        var script = bullets.GetComponent <BulletsBehaviour> ();

        script.Init(position_start, angle, tag_enemy, level_weapon, _carDataProperties);

        script.Register();

        bullets.gameObject.SetActive(true);
    }
Exemplo n.º 8
0
    public void RegisterData(CarDataProperties data)
    {
        _DataInMining.Add(data);

        double profit = data.ProfitPerSec;
        var    unit   = data.ProfitPerSecUnit;

        profit = profit * Mathf.Pow(data.ProfitPerUpgradeCoefficient, PlayerData.GetNumberUpgradeItemProfitCoefficient(data.Level));

        Helper.FixUnit(ref profit, ref unit);

        Helper.AddValue(ref _ProfitPerSec, ref _ProfitUnit, profit, unit);

        _RealProfitUnit   = _ProfitUnit;
        _RealProfitPerSec = _ProfitPerSec;

        GetRealEarning(ref _RealProfitPerSec, ref _RealProfitUnit);
    }
Exemplo n.º 9
0
    public void Init(Vector3 position_start, Vector3 angle_start, string tag_enemy, int level_weapon_upgrade, CarDataProperties _data)
    {
        _carDataProperties = _data;
        transform          = gameObject.transform;

        position = position_start;
        rotation = Quaternion.Euler(angle_start);

        transform.position    = position;
        transform.eulerAngles = angle_start;

        vector_forward = rotation * Vector.Vector3Up;

        speed_moving = (_carDataProperties.SpeedMoving + Contains.SpeedUpTimes * _carDataProperties.SpeedMoving) * 0.02f;
        enemy_tag    = tag_enemy;

        level_weapon = level_weapon_upgrade;

        IsUpdate = true;
    }
Exemplo n.º 10
0
    public void Start1()
    {
        List <CarDataProperties> _carData = new List <CarDataProperties>();

        for (int i = 0; i < 81; i++)
        {
            CarDataProperties _Properties = new CarDataProperties();

            int _index = 0;
            int _level = 0;
            if (i < _BulletsData.GetBulletDatas().Length)
            {
                _level = _BulletsData.GetBulletDatas()[i].Level;
                _index = i;
            }
            else
            {
                _level = i + 1;
                _index = 29;
            }
            _Properties.BulletId    = _BulletsData.GetBulletDatas()[_index].BulletId;
            _Properties.Level       = _level;
            _Properties.PrefabName  = "[Node] Item " + (i + 1);
            _Properties.Damage      = _BulletsData.GetBulletDatas()[_index].Damage;
            _Properties.DamageUnit  = _BulletsData.GetBulletDatas()[_index].DamageUnit;
            _Properties.SpeedMoving = _BulletsData.GetBulletDatas()[_index].SpeedMoving;

            _Properties.CritChange        = _BulletsData.GetBulletDatas()[_index].CritChange;
            _Properties.CritAmount        = _BulletsData.GetBulletDatas()[_index].CritAmount;
            _Properties.DamageMissRange   = _BulletsData.GetBulletDatas()[_index].DamageMissRange;
            _Properties.DamageCoefficient = _BulletsData.GetBulletDatas()[_index].DamageCoefficient;



            if (i < _ItemNodeImage.GetIcons().Length)
            {
                _Properties.Icon = _ItemNodeImage.GetIcons()[i].Icon;
            }
            else
            {
                _Properties.Icon = _BasePlaneComponents[i]._Sprite();
            }


            PoolEnums.PoolId ItemPoolId = 0;
            if (i < _ItemNodeDatal.GetItemNodeData().Length)
            {
                ItemPoolId = _ItemNodeDatal.GetItemNodeData()[_index].ItemPoolId;
                _index     = i;
            }
            else
            {
                ItemPoolId = (PoolEnums.PoolId)(123 + (i - 30));
                _index     = 29;
            }
            _Properties.ItemPoolId       = ItemPoolId;
            _Properties.PerCircleTime    = _ItemNodeDatal.GetItemNodeData()[_index].PerCircleTime;
            _Properties.ProfitPerSec     = _ItemNodeDatal.GetItemNodeData()[_index].ProfitPerSec;
            _Properties.ProfitPerSecUnit = _ItemNodeDatal.GetItemNodeData()[_index].ProfitPerSecUnit;
            _Properties.Exp                         = _ItemNodeDatal.GetItemNodeData()[_index].Exp;
            _Properties.Prices                      = _ItemNodeDatal.GetItemNodeData()[_index].Prices;
            _Properties.PricesUnit                  = _ItemNodeDatal.GetItemNodeData()[_index].PricesUnit;
            _Properties.PricesUpgrade               = _ItemNodeDatal.GetItemNodeData()[_index].PricesUpgrade;
            _Properties.PricesUnitUpgrade           = _ItemNodeDatal.GetItemNodeData()[_index].PricesUnitUpgrade;
            _Properties.PricesCoefficient           = _ItemNodeDatal.GetItemNodeData()[_index].PricesCoefficient;
            _Properties.PriceUpgradeCoefficient     = _ItemNodeDatal.GetItemNodeData()[_index].PriceUpgradeCoefficient;
            _Properties.ProfitPerUpgradeCoefficient = _ItemNodeDatal.GetItemNodeData()[_index].ProfitPerUpgradeCoefficient;
            _Properties.BuyFromLevel                = _ItemNodeDatal.GetItemNodeData()[_index].BuyFromLevel;


            if (i < _WeaponData.GetWeaponProperties().Length)
            {
                _index = i;
            }
            else
            {
                _index = 29;
            }
            _Properties.FireRate      = _WeaponData.GetWeaponProperties()[_index].FireRate;
            _Properties.NumberBullets = _WeaponData.GetWeaponProperties()[_index].NumberBullets;


            if (i < _ItemShopDetail.GetItemProperties().Length)
            {
                _index = i;
            }
            else
            {
                _index = 29;
            }
            _Properties.VSpeed   = _ItemShopDetail.GetItemProperties()[_index].Speed;
            _Properties.VEarning = _ItemShopDetail.GetItemProperties()[_index].Earning;
            _Properties.VDamage  = _ItemShopDetail.GetItemProperties()[_index].Damage;

            _carData.Add(_Properties);
        }
        _CarData.SetCarDataPropertie(_carData.ToArray());

        /*
         * public float  Speed;
         * public float  Earning;
         * public float  Damage;
         */
    }
Exemplo n.º 11
0
 public void SetItemData(CarDataProperties _itemNodeData)
 {
     _ItemNodeData          = _itemNodeData;
     sprite_renderer.sprite = GameData.Instance.ItemMoving.GetIcon(_itemNodeData.Level);
 }
Exemplo n.º 12
0
 public void Init(CarDataProperties data, string tag_enemy)
 {
     WeaponProperty = data;
     enemy_Tag      = tag_enemy;
 }