public override void Construct(AbilityUIConstructorInfo info)
    {
        base.Construct(info);

        Assert.IsTrue(indicatorSeperation.x >= 0);

        switch (type)
        {
            case AbilityType.MOVEMENT:
                // indicatorSeperation = indicatorSeperation;
                break;
            case AbilityType.GENERIC:
                indicatorSeperation = -indicatorSeperation;
                break;
        }

        int maxCharges = (info as ChargesAbilityUIConstructorInfo).numCharges;

        vfx = new ParticleSystem[maxCharges];

        for (int i = 0; i < maxCharges; i++)
        {
            Transform indicator = Instantiate(indicatorPrefab).transform;
            indicator.SetParent(this.transform, false);
            indicator.localPosition = i * indicatorSeperation;
            vfx[i] = indicator.GetComponent<ParticleSystem>();
            vfx[i].Play();
        }
    }
    public override void Construct(AbilityUIConstructorInfo info)
    {
        base.Construct(info);

        Assert.IsTrue(indicatorSeperation.x >= 0);

        switch (type)
        {
        case AbilityType.MOVEMENT:
            // indicatorSeperation = indicatorSeperation;
            break;

        case AbilityType.GENERIC:
            indicatorSeperation = -indicatorSeperation;
            break;
        }

        int maxCharges = (info as ChargesAbilityUIConstructorInfo).numCharges;

        vfx = new ParticleSystem[maxCharges];

        for (int i = 0; i < maxCharges; i++)
        {
            Transform indicator = Instantiate(indicatorPrefab).transform;
            indicator.SetParent(this.transform, false);
            indicator.localPosition = i * indicatorSeperation;
            vfx[i] = indicator.GetComponent <ParticleSystem>();
            vfx[i].Play();
        }
    }
示例#3
0
    public virtual void Construct(AbilityUIConstructorInfo info)
    {
        ability = info.ability;
        ability.Subscribe <AbilityStateChangedMessage>(this);
        GetComponentInParent <IObservable <ResetMessage> >().Subscribe <ResetMessage>(this);
        radius = radiusMultiplier * ability.transform.parent.GetComponentInChildren <CircleCollider2D>().radius;
        switch (type)
        {
        case AbilityType.MOVEMENT:
            transform.localPosition = new Vector2(radius, 0);
            break;

        case AbilityType.GENERIC:
            transform.localPosition = new Vector2(-radius, 0);
            break;
        }
    }
 public override void Construct(AbilityUIConstructorInfo info)
 {
 }
 public override void Construct(AbilityUIConstructorInfo info)
 { }