コード例 #1
0
    public override void Start()
    {
        healthBar = UIManager.I.healthBar;
        energyBar = UIManager.I.energyBar;


        attributes = GameManager.I.attributes;

        health = baseHealth + baseHealth * GameManager.I.costHolder.GetStatAsMultiplier(AttributeType.HEALTH);

        base.Start();
        facingDirection = Vector2.down;

        if (abilityManager == null)
        {
            abilityManager = GetComponentInChildren <AbilityManager>();
        }

        speed = normalSpeed;

        soundController = GetComponent <SoundController>();

        path = GetComponent <Pathfinding.AIPath>();

        MoveToPosition((Vector2)transform.position + Vector2.down * 3);

        energyBar.BuildHealtBar(maxEnergy, false);
        StartCoroutine(energyBar.FillAmount(energy / maxEnergy, false));
    }
コード例 #2
0
    public virtual void Start()
    {
        //ignoreMask = (1 << LayerMask.NameToLayer("Obstacles")) | (1 << LayerMask.NameToLayer("Characters"));
        ignoreMask = 1 << LayerMask.NameToLayer("Characters");

        colFilter.useLayerMask = true;
        colFilter.SetLayerMask(ignoreMask);

        rb = GetComponent <Rigidbody2D>();

        if (vision == null)
        {
            vision = transform.Find("Vision").GetComponent <CharacterVision>();
        }

        health = maxHealth;
        healthBar.BuildHealtBar(maxHealth, !(type.Equals(CharacterType.PLAYER) || type.Equals(CharacterType.BOSS)));

        nextAttackBG = nextAttackBar.transform.parent.gameObject;

        sprite = GetComponentInChildren <SpriteRenderer>();
    }
コード例 #3
0
 protected virtual void Start()
 {
     health = maxHealth;
     healthBar.BuildHealtBar(maxHealth, true);
 }