36 lines
626 B
C#
36 lines
626 B
C#
using UnityEngine;
|
|
|
|
internal class FishCanSeePlant : FishCanSeeObject
|
|
{
|
|
public override bool TestObject(GameObject go)
|
|
{
|
|
if (go == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (go.transform.position.y > 0f)
|
|
{
|
|
return false;
|
|
}
|
|
if (Fish.disableLogic2)
|
|
{
|
|
return false;
|
|
}
|
|
Fish occupyingFish = go.GetComponent<WaterPlant>().occupyingFish;
|
|
if (occupyingFish != null && occupyingFish != fish)
|
|
{
|
|
return false;
|
|
}
|
|
if (fish.debugLog)
|
|
{
|
|
Debug.Log("test plant " + fish.LikesPlant(go) + " " + go.gameObject.name);
|
|
}
|
|
return fish.LikesPlant(go);
|
|
}
|
|
|
|
public override bool AllowSearch()
|
|
{
|
|
return false;
|
|
}
|
|
}
|