// 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>(); _interactor = GetComponent <PetInteractor>(); _sounds = GetComponent <PetSounds>(); _stats = GetComponent <PetStats>(); string debugActionList = ""; // Use reflection to find every type that inherits from BasePetAction, instansiate it, and stick it in _actions foreach (var type in System.AppDomain.CurrentDomain.GetAllDerivedTypes(typeof(BasePetAction))) { var action = (BasePetAction)Activator.CreateInstance(type); action.Init(gameObject); _actions.Add(action); debugActionList += type.ToString() + " "; } Debug.Log("Loaded " + _actions.Count + " pet actions: " + debugActionList); StartCoroutine(Tick()); }
/// <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; }
private void SetUpSingleton() { if (instance == null) { instance = this; } else { if (instance != this) { Destroy(gameObject); } } DontDestroyOnLoad(gameObject); }
void Start() { hungerBar.transform.localPosition = new Vector2(fullBar, hungerBar.transform.localPosition.y); stats = pet.GetComponent <PetStats>(); }
// Start is called before the first frame update void Start() { itemID = 0; // kai bus item database sita fix itemTick = baseTick; petStats = this.gameObject.GetComponent <PetStats>(); }
// Start is called before the first frame update void Start() { action = gameObject.GetComponent <ActionScript>(); petstats = GameObject.Find("Gameplay manager").GetComponent <PetStats>(); }
public void PetTrophyBttn() { PetStats.SetActive(false); PetInv.SetActive(false); PetTrophy.SetActive(true); }
void Start() { _petBrain = GetComponent <PetBrain>(); _petStats = GetComponent <PetStats>(); StartCoroutine(CheckForTrill()); }
[SerializeField] float _wanderChangeRate; // how fast the wander heading changes in the direction // Start is called before the first frame update void Start() { _jellyMesh = GetComponent <JellyMesh>(); _stats = GetComponent <PetStats>(); }
void Start() { stats = pet.GetComponent <PetStats>(); }
// Use this for initialization void Start() { pStats = GetComponent<PetStats>(); }
void Start() { myPetObject = this.gameObject; FOV = transform.FindChild("PetFOV").GetComponent<PetFieldOfView>(); petStats = GameObject.Find("PetGarden").GetComponent<PetStats>(); petBelly = GameObject.Find("PetGarden").GetComponent<PetBelly>(); petInventory = GameObject.Find("PetGarden").GetComponent<Inventory>(); myEnergy = petBelly.GetMaxEnergy(); }
// Start is called before the first frame update void Start() { petStats = gameObject.GetComponent <PetStats>(); pet = GameObject.FindGameObjectWithTag("Pet"); }
// Start is called before the first frame update void Start() { touched = gameObject.GetComponent <ActionScript>(); petstats = GameObject.Find("Gameplay manager").GetComponent <PetStats>(); hp = Random.Range(2, 10); }