Exemple #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer != 12)
        {
            C_GravityAffected affect = other.GetComponent <C_GravityAffected>();

            if (!blockers.Contains(affect))
            {
                blockers.Add(affect);
            }

            isBlocked = CheckBlock();
        }
    }
    /// <summary>
    /// Gives the enemy a C_pather to follow.
    /// </summary>
    /// <param name="path"></param>
    public void SetPathToFollow(C_Pather path)
    {
        pathToFollow = path;

        currentFollow = path.GetPathAt(0);

        v3VariancePoisitionFollow = currentFollow.position;

        rbBody = GetComponent <Rigidbody>();

        swarmer = enemy as M_PathedEnemy;

        gAffect = GetComponent <C_GravityAffected>();
    }
Exemple #3
0
    void OnTriggerExit(Collider other)
    {
        if (other.gameObject.layer != 12)
        {
            C_GravityAffected affect = other.GetComponent <C_GravityAffected>();

            if (blockers.Contains(affect))
            {
                blockers.Remove(affect);
            }

            isBlocked = CheckBlock();

            if (startsNextSequenceOnUnlock && !played && !isBlocked)
            {
                C_SequenceHandler.Instance.NextSequence();
                played = true;
            }
        }
    }