// Use this for initialization
 void Start()
 {
     instance     = this;
     radius       = GetComponent <SphereCollider>().radius + 5f;
     wolves       = new List <GameObject>();
     nextIncrease = Time.time + increaseTime;
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     spawner      = WolfSpawner.instance;
     position     = transform.position;
     velocity     = Vector3.zero;
     acceleration = Vector3.zero;
     sneaking     = true;
 }
Exemplo n.º 3
0
    public void Bark()
    {
        if (wolfSpawner == null)
        {
            wolfSpawner = WolfSpawner.instance;
        }
        List <GameObject> wolves = wolfSpawner.GetNearbyWolves(transform.position, radius);

        foreach (GameObject wolf in wolves)
        {
            wolf.GetComponent <WolfAI>().Scare();
        }

        List <GameObject> sheps = SheepManager.instance.GetNearestSheeps(transform.position, radius);

        foreach (GameObject shep in sheps)
        {
            shep.GetComponent <SheepAINoHerd>().BarkedAt();
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     wolfSpawner = WolfSpawner.instance;
     radius      = GetComponent <SphereCollider>().radius;
     rb          = GetComponent <Rigidbody>();
 }