Example #1
0
        private void OnEffectEntityLoaded()
        {
            if (Widget == null)
            {
                EntityManager.Instance.FreeEntity(this.m_effectEntity);
                this.m_effectEntity = null;
                //GameEvents.SceneEvents.FreeEntityFromScene.SafeInvoke(this.m_effectEntity);
            }
            else
            {
                this.m_effectEntity.EntityObject.EntityTransform.SetParent(Widget, false);
                this.m_effectEntity.EntityObject.EntityTransform.localPosition = Vector3.zero;
                this.m_effectEntity.EntityScale        = Vector3.one;
                this.m_effectEntity.EntityObject.Layer = LayerDefine.UIShowLayer;
                if (ClearRotation)
                {
                    this.m_effectEntity.EntityObject.EntityTransform.localEulerAngles = Vector3.zero;
                }
                m_effectScaleComponent           = this.m_effectEntity.EntityObject.EntityGameObject.GetOrAddComponent <UIEffectScale>();
                m_effectScaleComponent.Scale     = m_effectScale;
                m_effectScaleComponent.RealScale = m_realScale;
                m_effectScaleComponent.SetSortingOrder(m_renderQueue);
                m_effectScaleComponent.SetSortingLayerName(m_sortingLayerName);
                FitUIScale = true;

                OnPlayEffect?.Invoke();

                LogicHandler.UIFrame.SetFrameDirty();

                this.m_effectEntity.Visible = Visible;
            }
        }
Example #2
0
    /// <summary>>> Scales a game object to the desired size.</summary>
    /// <param name="start_scale"> Starting scale.</param>
    /// <param name="final_scale"> Ending scale.</param>
    /// <param name="type"> Type of curve used for the movement.</param>
    /// <param name="duration"> Duration of the transition.</param>
    public void EffectScale(Vector2 start_scale, Vector2 final_scale, MovementType type, float duration)
    {
        if (working_element != null)
        {
            UIEffectScale ef_scale = new UIEffectScale(working_element, type, start_scale, final_scale, duration);

            curr_cluster.Add(ef_scale);

            last_effect = ef_scale;
        }
        else
        {
            EffectError();
        }
    }