示例#1
0
    /// <summary>
    /// Pull the relevant scripts from the Pet gameobject, called once at start of game
    /// </summary>
    /// <param name="pet"></param>
    public void Init(GameObject pet)
    {
        _petMovement   = pet.GetComponent <PetMovement>();
        _foodSpawner   = GameObject.Find("FoodSpawner").GetComponent <FoodSpawner>();
        _stockpileArea = GameObject.Find("StockpileArea").GetComponent <StockpileArea>();
        _interactor    = pet.GetComponent <PetInteractor>();
        _sounds        = pet.GetComponent <PetSounds>();
        _stats         = pet.GetComponent <PetStats>();
        _observer      = pet.GetComponent <PetObserver>();

        this._pet = pet;
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        _petMovement   = GetComponent <PetMovement>();
        _jellyMesh     = GetComponent <JellyMesh>();
        _renderer      = GetComponent <MeshRenderer>();
        _animator      = GetComponent <Animator>();
        _foodSpawner   = GameObject.Find("FoodSpawner").GetComponent <FoodSpawner>();
        _stockpileArea = GameObject.Find("StockpileArea").GetComponent <StockpileArea>();
        _interactor    = GetComponent <PetInteractor>();
        _sounds        = GetComponent <PetSounds>();

        StartCoroutine(Tick());
    }
示例#3
0
 void Awake()
 {
     _spawner       = GameObject.Find("FoodSpawner").GetComponent <FoodSpawner>();
     stockpileArea  = GameObject.Find("StockpileArea").GetComponent <StockpileArea>();
     windowLocation = GameObject.Find("WindowLocation").transform;
 }