private void FocusObjectUpdate() { Ray ray = _mainCamera.ViewportPointToRay(_viewportCenter); RaycastHit hit; if (Physics.Raycast(ray, out hit, _maxReticleDistance)) { if (hit.collider.CompareTag(CatConstant)) { if (_lookingAtCat == false) { LookingAtCat(); _lookingAtCat = true; _currentCatInFocus = hit.collider.GetComponent <CatBehaviour>(); } // Fire other event here that could highlite the cross hair // Thas UX babey if (Input.GetKeyDown(KeyCode.Mouse1)) { SelectCat(); } } else { NotLookingAtCat(); _lookingAtCat = false; _currentCatInFocus = null; } } }
public void SetUpDossier(CatBehaviour targetCat) { if (_dossierView != null) { _dossierView.SetTargetCat(targetCat.CatDialogue); } }
/// <summary> /// Clean Up CatManager, unsubscribe or remove values /// </summary> public void CleanUp() { foreach (var cat in _activeCats) { _catGenerator.DestroyCat(cat); } _activeCats.Clear(); _chosenCatToFind = null; }
public bool ClaimCat(CatBehaviour currentCatInFocus) { if (currentCatInFocus == _chosenCatToFind) { return(true); } else { return(false); } }
private void SetupCatParticles(CatBehaviour cat) { if (_particleGradients.Length == 0 || _particleSprites.Length == 0) { return; } int index = Random.Range(0, Mathf.Min(_particleSprites.Length, _particleGradients.Length)); cat.ParticleSprite = _particleSprites[index]; cat.ParticleStartColorRange = _particleGradients[index]; }
private CatBehaviour GetRandomCat() { CatBehaviour cat = _catGenerator.GetRandomCat(); cat.IsNameKnown = false; var spawnArea = Utilities.GetRandom(_spawnArea); var position = spawnArea.GetRandomUnitWithSphere(); var scale = Utilities.GetRandom(_catScaleRange); cat.Initialize(position, new Vector3(scale, scale, scale)); _activeCats.Add(cat); return(cat); }
public void SetFocusedCat(CatBehaviour cat) { _targetCat = cat; if (_actionBoxView != null) { if (cat.IsNameKnown) { _actionBoxView.SetTargetCat(cat.CatDialogue._catName); } else { _actionBoxView.SetTargetCat("???"); } } if (_dialogueBoxView != null) { _dialogueBoxView.SetCat(cat); } }
public void DestroyCat(CatBehaviour cat) { _dialogueOptions.RecycleCat(cat.CatDialogue); if (!_poolObjects) { Destroy(cat.gameObject); return; } if (_pool == null) { CreatePool(); } if (cat != null) { cat.gameObject.SetActive(false); _pool.Add(cat); } }
private void StoreRandomCatToFind() { if (_activeCats.IsNullOrEmpty()) { return; } List <CatBehaviour> validCats = new List <CatBehaviour>(); foreach (var cat in _activeCats) { if (cat.IsValidCat) { validCats.Add(cat); } } _chosenCatToFind = Utilities.GetRandom(validCats); SetupCamera(_chosenCatToFind); if (OnGeneratedSelectedCatToFind != null) { OnGeneratedSelectedCatToFind(_chosenCatToFind); } }
public void SetCat(CatBehaviour cat) { _dialogueBoxMenuView.SetupDialogueAnswers(cat); }
private void SetupCamera(CatBehaviour selectedCat) { RTCameraManager.Instance.SetupCameraLocation(selectedCat.GetCameraLocation()); RTCameraManager.Instance.OnTextureGenerated += StoreTexture; RTCameraManager.Instance.TakeCapture(); }
public void SetupDialogueAnswers(CatBehaviour cat) { _cat = cat; SetName(); }