Example #1
0
    private void Start()
    {
        sharkManager           = GameObject.FindGameObjectWithTag("SharkManager").GetComponent <SharkGroupManager>(); // Fetches the Shark Group Manager script from the Shark Manager object
        fishManager            = GameObject.FindGameObjectWithTag("FishManager").GetComponent <FishGroupManager>();   // Fetches the Fish Group Manager script from the Fish Manager object
        speed                  = Random.Range(sharkManager.minSpeed, sharkManager.maxSpeed);
        sharkDestinationTarget = Instantiate(sharkMovingTargetPrefab, transform.position, transform.rotation);
        sharkDestinationTarget.transform.position = PickRandomPoint();

        target = sharkDestinationTarget;
    }
Example #2
0
    private void Awake()
    {
        manager = GameObject.FindGameObjectWithTag("FishManager").GetComponent <FishGroupManager>(); // Fetches the Fish Group Manager script from the Fish Manager object
        fishDestinationTarget = GameObject.FindGameObjectWithTag("FishTarget");
        fishHealth            = this.GetComponent <FishHealth>();

        sphereCollider        = this.GetComponent <SphereCollider>();
        sphereCollider.radius = 125;

        currentFishState = FishState.Roaming;
    }
Example #3
0
    private void Start()
    {
        if (!slow && !fast)
        {
            medium = true;
        }

        fishManager = GameObject.FindGameObjectWithTag("FishManager").GetComponent <FishGroupManager>();

        Invoke("SpawnObjects", 0f);
    }
Example #4
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (!small && !large)
        {
            medium = true;
        }

        ChangeBoundsAndSizes();
    }
Example #5
0
    private void Awake()
    {
        fishGraphCanvas.SetActive(true);
        fishGraphCanvas.GetComponent <Canvas>().enabled = false;
        fishManager = GameObject.FindGameObjectWithTag("FishManager").GetComponent <FishGroupManager>();
        fishGraph.valueList.Add(fishManager.fishCount);
        fishGraph.ShowGraph(fishGraph.valueList, -1);

        kelpGraphCanvas.SetActive(true);
        kelpGraphCanvas.GetComponent <Canvas>().enabled = false;
        environmentManager = GameObject.FindGameObjectWithTag("EnvironmentManager").GetComponent <EnvironmentManager>();
        kelpGraph.valueList.Add(environmentManager.kelpCount);
        kelpGraph.ShowGraph(kelpGraph.valueList, -1);

        sharkGraphCanvas.SetActive(true);
        sharkGraphCanvas.GetComponent <Canvas>().enabled = false;
        sharkManager = GameObject.FindGameObjectWithTag("SharkManager").GetComponent <SharkGroupManager>();
        sharkGraph.valueList.Add(sharkManager.sharkCount);
        sharkGraph.ShowGraph(sharkGraph.valueList, -1);

        StartCoroutine("UpdateGraph");
    }
Example #6
0
    private void Start()
    {
        fishManager = GameObject.FindGameObjectWithTag("FishManager").GetComponent <FishGroupManager>();

        StartCoroutine("SpawnSharks");
    }
Example #7
0
    private void Start()
    {
        fishManager = GameObject.FindGameObjectWithTag("FishManager").GetComponent <FishGroupManager>();

        GenerateNewPositon();
    }