Esempio n. 1
0
    public void Launch(Vector3 target, float strength)
    {
        MyAddressse = LetterQueue.CurrentAddressee;
        LetterQueue.LetterLaunched();

        _startPos       = transform.position;
        _target         = target;
        _inFlight       = true;
        _launchTime     = Time.time;
        _launchDuration = MinDuration + (strength * (MaxDuration - MinDuration));
        _launchHeight   = MinHeight + (strength * (MaxHeight - MinHeight));
    }
 public void HoldLetter(InputAction.CallbackContext context)
 {
     if (context.performed)
     {
         if (blockHolder.HasLetter())
         {
             Letter letter = blockHolder.UseLetter();
             LetterQueue.SkipQueue(letter);
         }
         else if (activeObject != null)
         {
             blockHolder.HoldLetter(activeObject.GetComponent <Block>().GetLetter());
             Destroy(activeObject);
         }
     }
 }
Esempio n. 3
0
    private void Awake()
    {
        letter       = LetterQueue.GetNextLetter();
        isMultiplier = letter.isMultiplier;
        if (isMultiplier)
        {
            backGroundImage.gameObject.SetActive(true);
            particles.gameObject.SetActive(true);

            backGroundImage.color = new Color32(208, 177, 62, 255);
        }

        value          = letter.Value.ToString();
        scoreText.text = letter.Score.ToString();
        text.text      = value;
    }
Esempio n. 4
0
    public void RefreshText()
    {
        var letterQueue = LetterQueue.GetLetterQueue();

        for (int x = 0; x < previewTexts.Count && x < letterQueue.Count; x++)
        {
            if (previewTexts[x] != null)
            {
                previewTexts[x].text      = letterQueue[x].Value.ToString();
                previewTextScores[x].text = letterQueue[x].Score.ToString();
                if (letterQueue[x].isMultiplier)
                {
                    backgroundImages[x].color = new Color32(208, 177, 62, 255);
                }
                else
                {
                    backgroundImages[x].color = new Color32(124, 139, 154, 255);
                }
            }
        }
    }
Esempio n. 5
0
    private void OnThingGrabbed(GameObject gameObject)
    {
        TargetObject.SetActive(true);

        _grabbedObject = gameObject;

        Destroy(_grabbedObject.GetComponent <Grabbable>());

        _initialMousePosition = new Vector3(LoadViewPoint.x * 0.5f + 0.5f * Screen.width,
                                            LoadViewPoint.y * 0.5f + 0.5f * Screen.height, 0f);

        _initialMousePosition.z = _mainCamera.WorldToScreenPoint(_grabbedObject.transform.position).z;

        _grabbedObject.transform.position = GetFinalPosition();

        AudioPlayer.PlaySound("Scrumple", _grabbedObject.transform.position);

        LetterQueue.LetterGrabbed();

        _state = State.Loading;
    }