Esempio n. 1
0
    protected override void OnShootOnEvent()
    {
        GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab (TestData.charDB [0].Prefab);
        GameObject parent = StageManager.SharedInstance.EffectLayer;
        GameObject bullet = StageManager.SharedInstance.AddToStage (parent, bulletPrefab);

        baseBullet = bullet.AddComponent<BaseBullet> ();
        baseBullet.BattleAgent = this.BattleAgent;
        baseBullet.Speed = 1136.0f / 1000.0f;

        //从攻击点创建子弹
        //		Vector3 pos = MapUtil.RelativeMovePosition (this.BattleAgent.BaseSprite.HitPoint, BattleAgent.GameObject.transform);
        //		baseBullet.transform.position = new Vector3 (pos.x, pos.y, this.BattleAgent.GameObject.transform.position.z);

        baseBullet.transform.position = MapUtil.GetHitPointWorld (this.BattleAgent);

        AttackMessage message = new AttackMessage (this.BattleAgent, BattleAgent.Targets, 1);
        baseBullet.FlyToTarget (message);
    }
Esempio n. 2
0
    protected override void OnUltShootOnEvent()
    {
        GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab (TestData.charDB[4].Prefab);
        GameObject parent = StageManager.SharedInstance.EffectLayer;
        GameObject bullet = StageManager.SharedInstance.AddToStage (parent, bulletPrefab);
        baseBullet = bullet.AddComponent<BaseBullet> ();
        baseBullet.BattleAgent = this.BattleAgent;
        //baseBullet.transform.position  = battleAgent.GameObject.transform.position;
        baseBullet.Speed = 1136.0f / 1000.0f;
        Vector3 pos = MapUtil.GetHitPointWorld(BattleAgent.Targets[0]);

        baseBullet.transform.position = pos;

        baseBullet.FaceTo = this.BattleAgent.BaseSprite.FaceTo;

        AttackMessage message = new AttackMessage (BattleAgent, BattleAgent.Targets, 1);

        //baseBullet.FlyToTargetOutScreen (message);
        baseBullet.FlyToTarget (message);
    }
Esempio n. 3
0
    protected override void OnUltShootOnEvent()
    {
        List<BattleAgent> targets = BattleManager.SharedInstance.GetHeroList();
        for (int i = 0; i < targets.Count; i++) {

            List<BattleAgent> tlist=new List<BattleAgent>();
            tlist.Add(targets[i]);

            GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab (TestData.charDB [9].Prefab);
            GameObject parent = StageManager.SharedInstance.EffectLayer;
            GameObject bullet = StageManager.SharedInstance.AddToStage (parent, bulletPrefab);

            baseBullet = bullet.AddComponent<BaseBullet> ();
            baseBullet.BattleAgent = this.BattleAgent;
            baseBullet.transform.position = MapUtil.GetHitPointWorld(targets[i]);

            AttackMessage message = new AttackMessage (BattleAgent, tlist, 1);
            baseBullet.FlyToTarget (message,0.3f);
        }
    }
Esempio n. 4
0
    override protected void OnUltShootOnEvent()
    {
        GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab(TestData.charDB[4].Prefab);
        GameObject parent       = StageManager.SharedInstance.EffectLayer;
        GameObject bullet       = StageManager.SharedInstance.AddToStage(parent, bulletPrefab);

        baseBullet             = bullet.AddComponent <BaseBullet> ();
        baseBullet.BattleAgent = this.BattleAgent;
        //baseBullet.transform.position  = battleAgent.GameObject.transform.position;
        baseBullet.Speed = 1136.0f / 1000.0f;
        Vector3 pos = MapUtil.GetHitPointWorld(BattleAgent.Targets[0]);

        baseBullet.transform.position = pos;

        baseBullet.FaceTo = this.BattleAgent.BaseSprite.FaceTo;

        AttackMessage message = new AttackMessage(BattleAgent, BattleAgent.Targets, 1);

        //baseBullet.FlyToTargetOutScreen (message);
        baseBullet.FlyToTarget(message);
    }
Esempio n. 5
0
    override protected void OnUltShootOnEvent()
    {
        List <BattleAgent> targets = BattleManager.SharedInstance.GetHeroList();

        for (int i = 0; i < targets.Count; i++)
        {
            List <BattleAgent> tlist = new List <BattleAgent>();
            tlist.Add(targets[i]);

            GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab(TestData.charDB [9].Prefab);
            GameObject parent       = StageManager.SharedInstance.EffectLayer;
            GameObject bullet       = StageManager.SharedInstance.AddToStage(parent, bulletPrefab);

            baseBullet                    = bullet.AddComponent <BaseBullet> ();
            baseBullet.BattleAgent        = this.BattleAgent;
            baseBullet.transform.position = MapUtil.GetHitPointWorld(targets[i]);

            AttackMessage message = new AttackMessage(BattleAgent, tlist, 1);
            baseBullet.FlyToTarget(message, 0.3f);
        }
    }
Esempio n. 6
0
    override protected void OnShootOnEvent()
    {
        GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab(TestData.charDB [0].Prefab);
        GameObject parent       = StageManager.SharedInstance.EffectLayer;
        GameObject bullet       = StageManager.SharedInstance.AddToStage(parent, bulletPrefab);


        baseBullet             = bullet.AddComponent <BaseBullet> ();
        baseBullet.BattleAgent = this.BattleAgent;
        baseBullet.Speed       = 1136.0f / 1000.0f;

        //从攻击点创建子弹
//		Vector3 pos = MapUtil.RelativeMovePosition (this.BattleAgent.BaseSprite.HitPoint, BattleAgent.GameObject.transform);
//		baseBullet.transform.position = new Vector3 (pos.x, pos.y, this.BattleAgent.GameObject.transform.position.z);


        baseBullet.transform.position = MapUtil.GetHitPointWorld(this.BattleAgent);

        AttackMessage message = new AttackMessage(this.BattleAgent, BattleAgent.Targets, 1);

        baseBullet.FlyToTarget(message);
    }