Example #1
0
    public void CreateTrackingProjectile(BaseEntity source, BaseAbility ability, ProjectileItemParams param)
    {
        var projectile = new ProjectileItem(source, ability, param);

        projectile.ProjectileType = ProjectileType.Tracking;
        projectiles.Add(projectile);
    }
Example #2
0
    protected override bool ExeOnTarget(BaseEntity tar)
    {
        var info = new ProjectileItemParams();

        info.distance    = fixedDistance;
        info.startRadius = startRadius;
        info.endRadius   = endRadius;
        info.effectName  = effectName;
        ProjectileManager.Instance.CreateLinearProjectile(owner, null, info);
        return(true);
    }
Example #3
0
	public ProjectileItem(BaseEntity source, BaseAbility ability, ProjectileItemParams infoParams, EntityTarget target)
	{
		this.source = source;
		this.ability = ability;
		this.infoParams = infoParams;
		this.target = target;
		this.projectileID = ProjectileManager.Instance.GernerateProjectileID();
		this.velocity = infoParams.velocity;
		this.position = infoParams.spawnOrigin;
		this.expireTime = infoParams.expireTime;
		this.particleItem = new ParticleItem(this.infoParams.effectName, this.source);

		var obj = new GameObject("projectile"+projectileID);
		obj.AddComponent<BoxCollider>();
		shellObj = obj.transform;
		CObjectsPool.Instance.Instantiate("", infoParams.effectName, (_obj,uid)=>{
			var tmp = _obj as Transform;
			if(tmp != null) tmp.parent = shellObj;
		} ,ObjectType.Effect);
	}
Example #4
0
	public ProjectileItem(BaseEntity source, BaseAbility ability, ProjectileItemParams infoParams)
	{
		this.source = source;
		this.ability = ability;
		this.infoParams = infoParams;
		this.projectileID = ProjectileManager.Instance.GernerateProjectileID();
		this.velocity = infoParams.velocity;
		this.position = infoParams.spawnOrigin;
		this.expireTime = infoParams.expireTime;
		this.particleItem = new ParticleItem(this.infoParams.effectName, this.source);

		//碰撞的部分还需要特别写,为了服务器验证计算。
		var obj = new GameObject("projectile"+projectileID);
		collider = obj.AddComponent<CapsuleCollider>();
		collider.radius = this.infoParams.startRadius;

		shellObj = obj.transform;
		CObjectsPool.Instance.Instantiate("", infoParams.effectName, (_obj,uid)=>{
			var tmp = _obj as Transform;
			if(tmp != null) tmp.parent = shellObj;
		} ,ObjectType.Effect);
	}