/// <summary> /// Send References to the AI script /// </summary> /// <param name="aiControl"></param> /// <param name="rbRef"></param> /// <param name="cusPart"></param> public void GrabAIReferences(AI_Controller aiControl, Rigidbody2D rbRef, CustomParticles cusPart, AI_WallRay aiRay, TokenController token) { aiControlRef = aiControl; rb = rbRef; particlControlRef = cusPart; aiWallRay = aiRay; tokenControlRef = token; }
// Use this for initialization void Start() { //Set patrol path start = new Vector3(transform.position.x - destDist, transform.position.y); des = new Vector3(transform.position.x + destDist, transform.position.y); //Grab AI References aiRef = GetComponent <AI>(); aiControlRef = GetComponent <AI_Controller>(); customPartRef = GetComponentInChildren <CustomParticles>(); rbRef = GetComponent <Rigidbody2D>(); aiWallRayRef = GetComponentInChildren <AI_WallRay>(); playerChar = GameObject.FindGameObjectWithTag("Player").transform; tokenControl = GameObject.FindGameObjectWithTag("PlayerReferences").GetComponent <TokenController>(); ApplyAIReferences(); }