예제 #1
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();
        agent      = GetComponent <NavMeshAgent>();
        animator   = GetComponent <Animator>();
        groundMask = LayerMask.GetMask("Floor");

        state = SURVIVORSTATE.NORMAL;

        currentHealth = 100.0f;


        if (healthSlider != null)
        {
            healthSlider.value = currentHealth;
        }

        weaponList = GetComponents <Weapon>();


        foreach (Weapon w in weaponList)
        {
            w.enabled = true;
            w.DisableWeapon();
            if (w.type == WEAPON_TYPE.PISTOL)
            {
                currentWeapon = w;
                currentWeapon.EnableWeapon();
            }
        }
    }
예제 #2
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();
        agent      = GetComponent <NavMeshAgent> ();
        animator   = GetComponentInChildren <Animator> ();
        groundMask = LayerMask.GetMask("Ground");

        state = SURVIVORSTATE.NORMAL;
        GameManager.AddSurvivor(this);

        weaponList = GetComponentsInChildren <Weapon> ();

        foreach (Weapon w in weaponList)
        {
            w.enabled = false;
            if (w.type == WEAPON_TYPE.PISTOL)
            {
                currentWeapon         = w;
                currentWeapon.enabled = true;
            }
        }
    }
예제 #3
0
 protected override void Dead()
 {
     state           = SURVIVORSTATE.DEAD;
     agent.isStopped = true;
     GameManager.RemoveSurvivor(this);
 }
예제 #4
0
 protected override void Dead()
 {
     state           = SURVIVORSTATE.DEAD;
     agent.isStopped = true;
 }