Пример #1
0
        private void InitLetter()
        {
            m_LetterObjectView = m_CurrentLetter.GetComponent <LivingLetterController>();

            if (ColorTickleConfiguration.Instance.Variation == ColorTickleVariation.Image)
            {
                m_LetterObjectView.TransformIntoImage();
                m_LetterObjectView.LabelRender.color = Color.white;
            }

            m_TMPTextColoringLetter = m_CurrentLetter.GetComponent <TMPTextColoring>();
            m_SurfaceColoringLetter = m_CurrentLetter.GetComponent <SurfaceColoring>();

            m_LLController = m_CurrentLetter.GetComponent <ColorTickle_LLController>();
            m_LLController.movingToDestination = true;

            m_HitStateLLController = m_CurrentLetter.GetComponent <HitStateLLController>();
            m_HitStateLLController.OnTouchedOutside += OnTickled;

            m_LLController.OnDestinationReached += delegate() {
                game.Context.GetAudioManager().PlayVocabularyData(
                    m_LetterObjectView.Data,
                    soundType: ColorTickleConfiguration.Instance.GetVocabularySoundType()
                    );
            };//play audio on destination


            m_HitStateLLController.OnTouchedShape += TryEnableAntura;
            //game.anturaController.targetToLook = m_CurrentLetter.transform; //make antura look at the LL on rotations

            SetBrushColor(m_ColorsUIManager.defaultColor);

            ResetLaunchTimer(true);
        }
Пример #2
0
        public EggLivingLetter(Transform parent, GameObject letterObjectViewPrefab, GameObject shadowPrefab, ILivingLetterData livingLetterData, Vector3 startPosition, Vector3 shadowPosition, Vector3 endPosition, float delay, Action endCallback)
        {
            livingLetter = UnityEngine.Object.Instantiate(letterObjectViewPrefab).GetComponent <LivingLetterController>();

            livingLetter.transform.SetParent(parent);
            livingLetter.transform.localPosition = startPosition;


            if (livingLetterData.DataType == LivingLetterDataType.Letter)
            {
                ((LL_LetterData)livingLetterData).ForceShowAccent = true;
            }
            livingLetter.Init(livingLetterData);


            livingLetter.transform.localScale *= startScale;
            livingLetter.gameObject.SetActive(false);

            if (EggConfiguration.Instance.Variation == EggVariation.Image)
            {
                livingLetter.TransformIntoImage();
            }

            shadowTransform = UnityEngine.Object.Instantiate(shadowPrefab).transform;
            shadowTransform.SetParent(parent);
            shadowLocalPosition           = shadowPosition;
            shadowTransform.localPosition = shadowLocalPosition;
            shadowTransform.localScale   *= 0.7f;
            shadowTransform.gameObject.SetActive(false);

            this.startPosition = startPosition;
            this.endPosition   = endPosition;

            this.delay = delay;

            this.endCallback = endCallback;

            JumpToEnd();
        }