コード例 #1
0
    // 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);
    }
コード例 #2
0
 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);
 }
コード例 #3
0
    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);
    }