Пример #1
0
    private float _attackDelay = 1.3f; // set to some value when adding animations

    private void Start()
    {
        target = PlayerManager.instance.player.transform;
        playerControllerScript = target.GetComponentInParent <PlayerController_Sword>();
        agent              = GetComponent <NavMeshAgent>();
        anim               = this.GetComponentInParent <Animator>();
        attackSlotManager  = target.GetComponentInParent <SamuraiAttackSlotManager>();
        waitSlotManager    = target.GetComponentInParent <WaitSlotManager>();
        playerHealthScript = target.GetComponentInChildren <Health>();
        _attackDistance    = attackSlotManager.distance + 0.2f;
        spawnManager       = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnManager>();

        SetRandomLocation();
    }
Пример #2
0
    //public void OnHit(float damage)
    //{
    //    _samuraiHealth.damage(damage);
    //}

    private void FindPlayer()
    {
        target            = PlayerManager.instance.player.transform;
        attackSlotManager = target.GetComponentInParent <SamuraiAttackSlotManager>();
    }