0
点赞
收藏
分享

微信扫一扫

项目实训-小鬼僵尸

半夜放水 2022-04-22 阅读 81
unityc#

本次完成了小鬼僵尸,逻辑和普通僵尸比较像

代码

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class SmallZombie : ZombieBase
{
    protected override int MaxHP => 200;

    protected override float speed => 3;

    protected override float attackValue => 100;

    protected override GameObject Prefab => GameManager.Instance.GameConf.SmallZombie;

    protected override bool isSpecial => false;

    public override Vector2 offset => new Vector2(-0.86f, -0.37f);

    public override void SpecialMove()
    {
        return;
    }

    public override void InitZombieHpState()
    {
        zombieHpState = new ZombieHpState(
           0,
           new List<int>() { MaxHP },
           new List<string>() { "SmallZombieWalk"},
           new List<string>() { "SmallZombieAttack" },
           new List<UnityAction>() { null}
           );
    }

    public override void OnDead()
    {
        if (!isSpecialDie)  //如果不是特殊死法

        {// 创建一个死亡身体
            SmallZombie_DieBody body = PoolManager.Instance.GetObj(GameManager.Instance.GameConf.SmallZombie_Diebody).GetComponent<SmallZombie_DieBody>();
            body.Init(animator.transform.position);
        }
    }


}

举报

相关推荐

项目实训-不死僵尸

项目实训-读报僵尸

项目实训(三)

项目实训六

项目实训-杨桃

SDUCSRP项目实训一

项目实训-火爆辣椒

0 条评论