/// <summary>
    /// 读取子弹配置列表
    /// </summary>
    /// <returns></returns>
    public static Dictionary <int, BulletProperty> ReadBulletProperty()
    {
        DataRowCollection dataLst = ReadExcel.GameReadExcel(ExcelPathConfigs.BULLET_ROPERTY_PATH);
        Dictionary <int, BulletProperty> bulletPropertyDict = new Dictionary <int, BulletProperty>();

        if (dataLst == null)
        {
            Debug.Log("ReadBulletProperty is failed! DataRowCollection obj is null!");
            return(bulletPropertyDict);
        }
        for (int i = 1; i < dataLst.Count; i++)
        {
            BulletProperty data    = new BulletProperty();
            DataRow        excelst = dataLst[i];
            if (excelst[0].ToString() == "" && excelst[1].ToString() == "")
            {
                continue;
            }

            data.Id         = int.Parse(excelst[0].ToString());  //子弹id
            data.BulletName = excelst[1].ToString();             //子弹名称

            data.Damage      = int.Parse(excelst[2].ToString()); //子弹伤害
            data.MaxDamage   = int.Parse(excelst[3].ToString()); //子弹伤害
            data.PrefabsPath = excelst[4].ToString();            //子弹路径

            bulletPropertyDict.Add(data.Id, data);
        }
        return(bulletPropertyDict);
    }
 // Use this for initialization
 void Start()
 {
     bulletProperty = new BulletProperty
     {
         debuffTime  = towerLevel * 0.3f,
         debuffValue = towerLevel * 0.4f
     };
 }
 // Use this for initialization
 void Awake()
 {
     bulletManagerPos = GameObject.Find("BulletManager").transform.position;
     player           = GameObject.Find("Player");
     property         = this.GetComponent <BulletProperty>();
     ParticleManager  = GameObject.Find("ParticleManager");
     pool             = ParticleManager.GetComponent <ParticlePool>();
 }
    /// <summary>
    /// 获取伤害值
    /// </summary>
    /// <param name="id"></param>
    /// <param name="BulletData"></param>
    /// <param name="maxAccumulateTime"></param>
    /// <returns></returns>
    public int GetDamage(int id, FP maxAccumulateTime)
    {
        BulletProperty BulletData = GameManager.Instance.GetBulletProPerty(id);
        FP             damageTime = maxAccumulateTime / (BulletData.MaxDamage - BulletData.Damage);
        int            damageNum  = (int)(_accumulateTime / damageTime);

        return(BulletData.Damage + damageNum);
    }
Beispiel #5
0
 void Start()
 {
     bulletProperty = new BulletProperty
     {
         debuffTime  = towerLevel * 0.5f,
         debuffValue = (towerLevel * (towerLevel - 1)) * 0.1f + 0.25f
     };
 }
Beispiel #6
0
 // 减速buff
 private void DecreaseSpeed(BulletProperty bulletProperty)
 {
     if (!hasDecreasSpeed)
     {
         moveSpeed -= bulletProperty.debuffValue;
         TshitGo.SetActive(true);
     }
     decreaseSpeedTimeVal = 0;
     hasDecreasSpeed      = true;
     decreaseTime         = bulletProperty.debuffTime;
 }
Beispiel #7
0
 //减速Debuff的方法
 private void ShitDecrease(BulletProperty bulletProperty)
 {
     if (!isShitDecrease)                                    //如果之前没有被减速
     {
         moveSpeed = moveSpeed - bulletProperty.debuffValue; //减速
         Tshit.SetActive(true);                              //减速效果
     }
     shitDecreaseSpeedTimeVal = 0;                           //每次收到减速攻击时,重置减速计时器
     shitDecreaseTime         = bulletProperty.debuffTime;   //更新减速
     isShitDecrease           = true;                        //打开减速开关
 }
Beispiel #8
0
 // 受到减速buff的效果
 private void DecreaseDebuff(BulletProperty bulletProperty)
 {
     if (!hasDecreaseSpeed) // 没有减速才受到buff
     {
         moveSpeed -= bulletProperty.debuffValue;
         shit.SetActive(true);
     }
     decreaseTimer    = 0;
     decreaseTime     = bulletProperty.debuffTime;
     hasDecreaseSpeed = true;
 }
 //减速方法
 private void DecreaseSpeed(BulletProperty bulletProperty)
 {
     TshitGo.SetActive(true);
     decreaseTimeVal = 0; //每次收到便便攻击减速时间要重置
     decreaseTime    = bulletProperty.debuffTime;
     if (hasDecreasSpeed) //防止速度被降到0
     {
         return;
     }
     moveSpeed       = moveSpeed - bulletProperty.debuffValue;
     hasDecreasSpeed = true;
 }
Beispiel #10
0
 void Awake()
 {
     bulletProperty = new BulletProperty
     {
         shootIntervalSec  = 0.4f,
         simultaneousCount = 1,
     };
     humanController   = GetComponent <HumanController>();
     bulletControllers = new List <BulletController>();
     for (int i = 0; i < 10; i++)
     {
         bulletControllers.Add(Instantiate(bulletPrefab, Vector3.zero, Quaternion.identity));
         bulletControllers[i].OnInstantiate(transform, speed);
     }
 }
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 protected void Awake()
 {
     _bullet     = GetComponent <BulletProperty> ();
     _bulletMove = GetComponent <BulletMovement> ();
 }
 // Use this for initialization
 void Awake()
 {
     bulletManagerPos = GameObject.Find("BulletManager").transform.position;;
     property         = this.GetComponent <BulletProperty>();
 }