// Start is called before the first frame update void Start() { viewDistanceVar = viewDistance; visionConeScript = Instantiate(visionConePrfb, visionConeGroup.transform).GetComponent <VisionCone>(); visionConeScript.SetFov(fov); visionConeScript.SetViewDistance(viewDistanceVar); }
public virtual void ChangeStats(float newDistance, float newFov, float newSpeed) { fovVar = newFov; viewDistanceVar = newDistance; speed = newSpeed; // Actualiza los valores del cono visionConeScript.SetFov(fovVar); visionConeScript.SetViewDistance(viewDistanceVar); }
private void Awake() { player = FindObjectOfType <BlinkScript>().gameObject; followPlayer = false; // Empezar en modo "Passive" speed = passiveSpeed; // Empezar a la velocidad de patrulla cadenceTimer = cadence; gun.rotation = Quaternion.identity; gfxAnimator = GetComponentInChildren <Animator>(); gfxAnimator.SetTrigger("Walk"); // PATHFINDING seeker = GetComponent <Seeker>(); rb = GetComponent <Rigidbody2D>(); fovVar = fov; viewDistanceVar = viewDistance; // CONO VISION visionConeScript = Instantiate(visionConePrfb, visionConeGroup.transform).GetComponent <VisionCone>(); visionConeScript.SetFov(fovVar); visionConeScript.SetViewDistance(viewDistanceVar); }