Beispiel #1
0
		public override void OnActive(int ownerID, SkillParam skillParam)
		{
			if (skillParam.templateID <= 0)
				return;

			int skillId = skillParam.templateID;
			Skill_Tbl skillTbl = ConfigPool.Instance.GetDataByKey<Skill_Tbl>(skillId);
			if (null == skillTbl)
			{
				Log.LogError("SkillLogicShoot.OnActive : invalid skill id : " + skillId);
				return;
			}

			int bulletId = skillTbl.buff1[0];
			Projectile_Tbl bulletTbl = ConfigPool.Instance.GetDataByKey<Projectile_Tbl>(bulletId);
			if (null == bulletTbl)
			{
				Log.LogError("SkillLogicShoot.OnActive : invalid bullet id in skill " + skillId);
				return;
			}

			Agent ownerAgent = AgentManager.Instance.Find(ownerID);
			Agent targetAgent = null;
			Vector3 pos = ownerAgent.transform.position;
			pos.y = 1.0f;
			Vector3 dir = ownerAgent.transform.forward;
			ProjectileManager.Instance.SpawnProjectile(ownerAgent, targetAgent, bulletId, pos, dir);

		}
Beispiel #2
0
		public override void OnActive(int ownerID, SkillParam skillParam)
		{
			if (skillParam.templateID <= 0)
				return;

			Skill_Tbl skillTbl = ConfigPool.Instance.GetDataByKey<Skill_Tbl>(skillParam.templateID);
			if (null == skillTbl)
			{
				Log.LogError("SkillLogicBuff.OnActive : invalid skill id.");
				return;
			}

			if (skillTbl.buff1[0] > 0)
			{
				BuffParam buffParam = new BuffParam();
				buffParam.templateID = skillTbl.buff1[0];
				buffParam.senderID = ownerID;
				buffParam.receiverID = skillParam.targetID;

				BuffManager.Instance.AddBuff(ownerID, buffParam);
			}
		}