예제 #1
0
    private void OnTriggerStay(Collider other)
    {
        Debug.Log(myGetLaid.hornyLevelBreedThreshold);

        if (other.tag == "Food" && myGetFood.hunger >= 5f && myAgentState.myState == State.Wandering)
        {
            Debug.Log("carrot");

            myGetFood.targetFood = other.gameObject;
            myAgentState.myState = State.GettingFood;
        }

        if (other.tag == "Bunny" && myGetLaid.hornyLevel >= 10f && myAgentState.myState == State.Wandering)
        {
            GameObject otherBunny   = other.gameObject;
            GetLaid    otherGetLaid = otherBunny.GetComponent <GetLaid>();

            if (otherGetLaid.hornyLevel >= 10f)
            {
                myGetLaid.targetMate    = otherBunny;
                otherGetLaid.targetMate = this.gameObject;
                otherGetLaid.MadeMate();
                myAgentState.myState = State.Breeding;
            }
        }
    }
예제 #2
0
    private void Awake()
    {
        myWander  = this.GetComponentInChildren <Wander>();
        myGetLaid = this.GetComponentInChildren <GetLaid>();

        RandomiseStats();
    }
예제 #3
0
    // Start is called before the first frame update
    void Start()
    {
        myAgentState = agent.GetComponent <AgentState>();
        myGetFood    = agent.GetComponent <GetFood>();
        myGetLaid    = agent.GetComponent <GetLaid>();

        this.gameObject.transform.localScale = new Vector3(sightRange * 2, sightRange, this.gameObject.transform.localScale.z);
    }