Exemple #1
0
    void CreateBullet()
    {
        switch (ToTarget)
        {
        case ToTargetType.Once:
            PrepareTime = 0;
            foreach (Creature crt in Effect.CurtTargets)
            {
                CreatureView cv = Owner.Owner.FCtrllerView.GetCreatureView(crt);
                BulletView   bv = CreateBullet(crt);
                PrepareTime = Mathf.Max(PrepareTime, bv.FlyTime);
            }
            break;

        case ToTargetType.Sequent:
        {
            BulletView bv = CreateBullet(Effect.CurtTargets.ToArray());
            PrepareTime      = bv.CurtFlyTime;
            bv.OnReachTarget = (blt, idx) => { NextTargetTime = blt.CurtFlyTime; };
        }
        break;

        case ToTargetType.OneFirst:
        {
            CreatureView cv = Owner.Owner.FCtrllerView.GetCreatureView(Effect.CurtTargets[0]);
            CreateBullet(Effect.CurtTargets[0]);
        }
        break;
        }
    }
Exemple #2
0
    public void Create(Skill sk, CreatureView crt)
    {
        m_skill = sk;
        m_owner = crt;

        m_skill.OnCastPrepare += OnPrepareCast;
        m_skill.OnCast        += OnCast;
        m_skill.OnCastOver    += OnOver;

        m_effects = new EffectBaseView[sk.Effects.Length];
        for (int i = 0; i < m_effects.Length; ++i)
        {
            EffectBase eb = sk.Effects[i];

            string k = "";
            if (string.IsNullOrEmpty(eb.Proto.EffectViewOverride))
            {
                k = eb.Proto.Key;
            }
            else
            {
                k = eb.Proto.EffectViewOverride;
            }
            GameObject obj_e = ResMgr.Instance.CreateGameObject("Effect/" + k, gameObject);
            m_effects[i] = obj_e.GetComponent <EffectBaseView>();
            m_effects[i].Create(eb, this);
        }

        Cache();
    }
Exemple #3
0
    void OnAddCreature(Creature crt, Int2D pt)
    {
        CreatureView crtv = ResMgr.Instance.CreateGameObject("UI/Crt", Launcher.Instance.CanvasUI.gameObject).GetComponent <CreatureView>();

        crtv.Create(crt, this);
        crtv.UpdateTransform(pt);
        m_crts[crt] = crtv;
    }
Exemple #4
0
    protected override void ActiveInternal(Creature target)
    {
        base.ActiveInternal(target);

        CreatureView cv = Owner.Owner.FCtrllerView.GetCreatureView(target);

        if (PrefabFxTarget != null)
        {
            FxBase fb = FxPool.Instance.Alloc(PrefabFxTarget);
            fb.transform.localPosition = cv.transform.localPosition;
        }
    }
Exemple #5
0
 public void Create(CreatureView cv)
 {
     m_crt_view        = cv;
     Crt.OnDead       += OnDead;
     Crt.OnTakeDamage += OnTakeDamage;
 }