void Start() { bunnyManager = this.GetComponentInParent <BunnyManager>(); hasEaten = false; foodManager = GameObject.FindObjectOfType <FoodManager>(); myWander = this.GetComponent <Wander>(); myAgentState = this.GetComponent <AgentState>(); movementSpeed = myWander.movementSpeed; minimumDistToAvoid = myWander.minimumDistToAvoid; force = myWander.force; SetRotateSpeedAndDodgeTimeFromSpeed(); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } bunnyManagerInstance = GetComponentInChildren <BunnyManager>(); roundManagerInstance = GetComponentInChildren <RoundManager>(); humansManagerInstance = GetComponentInChildren <HumansManager>(); moneyManagerInstance = GetComponentInChildren <MoneyManager>(); }
void Awake() { BunnyM = this; }