Example #1
0
        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;
                }
            }
        }
Example #2
0
 public void SetUpDossier(CatBehaviour targetCat)
 {
     if (_dossierView != null)
     {
         _dossierView.SetTargetCat(targetCat.CatDialogue);
     }
 }
Example #3
0
 /// <summary>
 /// Clean Up CatManager, unsubscribe or remove values
 /// </summary>
 public void CleanUp()
 {
     foreach (var cat in _activeCats)
     {
         _catGenerator.DestroyCat(cat);
     }
     _activeCats.Clear();
     _chosenCatToFind = null;
 }
Example #4
0
 public bool ClaimCat(CatBehaviour currentCatInFocus)
 {
     if (currentCatInFocus == _chosenCatToFind)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #5
0
        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];
        }
Example #6
0
        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);
        }
Example #7
0
 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);
     }
 }
Example #8
0
        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);
            }
        }
Example #9
0
        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);
 }
Example #11
0
 private void SetupCamera(CatBehaviour selectedCat)
 {
     RTCameraManager.Instance.SetupCameraLocation(selectedCat.GetCameraLocation());
     RTCameraManager.Instance.OnTextureGenerated += StoreTexture;
     RTCameraManager.Instance.TakeCapture();
 }
Example #12
0
 public void SetupDialogueAnswers(CatBehaviour cat)
 {
     _cat = cat;
     SetName();
 }