예제 #1
0
    private void Start()
    {
        navI = GetComponent <AIAgent>().navInterface;
        if (useOnlyStaticCover && shouldUseDynamicCover)
        {
            verts = navI.GetNavmeshVertices();
        }

        myTransform = transform;
        //dynamicCoverMaxDistFromMeSqr = dynamicCoverMaxDistFromMe*dynamicCoverMaxDistFromMe;
        maxCoverDistSqrd     = maxCoverDistFromEnemy * maxCoverDistFromEnemy;
        minCoverDistSqrd     = minCoverDistFromEnemy * minCoverDistFromEnemy;
        layerMask            = AIController.Instance.layerMask;
        defendingDistSquared = defendingDist * defendingDist;
        minDistToAdvance     = minDistToAdvance * minDistToAdvance;

        if (AIController.Instance != null)
        {
            coverNodes = AIController.Instance.GetCovers();
        }
        else
        {
            Debug.LogError(
                "No Controller has been detected!  An AIController is required for the AI to work!  Please create a new gameObject and attach the Paragon AI ControllerScript to it!");
        }
    }
예제 #2
0
 protected BaseState(AIAgent aiAgent)
 {
     this.aiAgent  = aiAgent;
     aiCoverFinder = aiAgent.coverFinder;
     aiShooting    = aiAgent.aiShooting;
     navInterface  = aiAgent.navInterface;
     layerMask     = aiAgent.layerMask;
     transform     = aiAgent.transform;
 }
예제 #3
0
    private void Awake()
    {
        aiShooting  = GetComponent <AIShooting>();
        coverFinder = GetComponent <AICoverFinder>();

        mTransform = transform;

        navInterface = gameObject.AddComponent <NavmeshInterface>();
        navInterface.Init(gameObject, agentStats);
    }