Example #1
0
    public virtual void Reset()
    {
        transform.position = originPos;
        transform.rotation = originRot;

        SetEnableColliders(true);

        m_PathDestinationNodeIndex = 1;
        if (agent.isActiveAndEnabled)
        {
            agent.ResetPath();
        }
        agent.stoppingDistance = 0f;
        fov.Reset();

        idleTimer   = -1;
        idleWaiting = false;

        warnedTimer = 0f;
        attackFase  = AttackFase.NO;

        animator.Rebind();

        if (soundSource[2].clip != null)
        {
            soundSource[2].loop = true;
        }

        if (initialStatus != Status.INACTIVE)
        {
            spawn = true;
            animator.SetTrigger(animVarSpawn);
        }
        else
        {
            spawn = false;
        }

        status = initialStatus;
    }