Example #1
0
        public void OnPointerUp(PointerEventData eventData)
        {
            if (!this.enabled)
            {
                return;
            }
            if (DeviceInput.UF_Up(0))
            {
                //Vector2 anchoredPosition = this.rectTransform.anchoredPosition;
                if (autoBack)
                {
                    if (smoothBack <= 0)
                    {
                        this.transform.localPosition = m_SourceLPosition;
                    }
                    else
                    {
                        FrameHandle.UF_AddCoroutine(UF_ISmoothBack(this.transform.localPosition, m_SourceLPosition, smoothBack));
                    }
                }

                m_IsDragging = canDrag && false;

                //判断Group中的碰撞
                if (m_DragGroup != null)
                {
                    m_DragGroup.UF_UpdateCollision(this, eventData);
                }

                if (!string.IsNullOrEmpty(ePressUp))
                {
                    MessageSystem.UF_GetInstance().UF_Send(DefineEvent.E_UI_OPERA, ePressUp, eParam, this);
                }
            }
        }
Example #2
0
        public int UF_AddSpeedTransPostion(
            UnityEngine.Object target,
            Vector3 vfrom,
            UnityEngine.Object toObject,
            float speed,
            bool ingoreTimeScale,
            float heightOffset,
            bool spaceWorld,
            Vector2 offset,
            bool focusAngle,
            DelegateVoid eventFinish
            )
        {
            int       id           = 0;
            Transform transform    = UF_ObjectToTransform(target);
            Transform tarTransform = UF_ObjectToTransform(toObject);

            if (transform != null)
            {
                if (speed <= 0)
                {
                    throw new System.Exception("speed can not less than 0");
                }
                float dis      = Vector3.Distance(tarTransform.position, transform.position);
                float duration = dis / speed;
                id = FrameHandle.UF_AddCoroutine(UF_MotionTransPosition(transform, vfrom, tarTransform, duration, ingoreTimeScale, heightOffset, spaceWorld, offset, focusAngle, eventFinish));
            }
            return(id);
        }
Example #3
0
        IEnumerator UF_CoGameStart()
        {
            Debugger.UF_Log("GameMain Start Begain");
            MessageSystem.UF_GetInstance().UF_Send(DefineEvent.E_MAIN_PRE_START);
            //获取native 配置
            yield return(StartCoroutine(GlobalSettings.UF_InitExternInfo()));

            //初始化全局配置表
            yield return(StartCoroutine(GlobalSettings.UF_InitGameConfigs()));

            //检查版本更新
            yield return(StartCoroutine(UpgradeSystem.UF_GetInstance().UF_CheckUpgrade()));

            //资源系统初始化
            yield return(StartCoroutine(AssetSystem.UF_GetInstance().UF_InitAssetSystem()));

            //LuaFramework 初始化
            //yield return StartCoroutine(LuaFramework.UF_GetInstance().UF_InitFramework());
            FrameHandle.UF_OnStart();
            MessageSystem.UF_GetInstance().UF_Send(DefineEvent.E_MAIN_START);
            Debugger.UF_Log("GameMain Start Over");

            MessageSystem.UF_GetInstance().UF_AddListener(DefineEvent.E_START_BATTLE, OnAllReady);
            MessageSystem.UF_GetInstance().UF_AddListener(DefineEvent.E_CLIENT_MSG, OnClientMsg);
            MessageSystem.UF_GetInstance().UF_AddListener(DefineEvent.E_StartFrameSync, OnStartFrameSync);
            MessageSystem.UF_GetInstance().UF_AddListener(DefineEvent.E_StopFrameSync, OnStopFrameSync);

            com.unity.mgobe.src.Util.RandomUtil.Init(int.Parse(GetTimeStamp()));

            //AllUI.Instance.Show("PanelLogin");
            UIManager.UF_GetInstance().UF_ShowView("UI System", "ui_panellogin", null);
            yield break;
        }
Example #4
0
 public int UF_SmoothOverFlow(float insValue, float duration, bool ingoreTimeScale, DelegateMethod callback)
 {
     if (!this.gameObject.activeInHierarchy)
     {
         return(0);
     }
     if (duration <= 0)
     {
         this.value = (this.value + insValue) % 1.0f;
         if (callback != null)
         {
             callback(null);
         }
         return(0);
     }
     else
     {
         if (m_HandlerSmooth != 0)
         {
             FrameHandle.UF_RemoveCouroutine(m_HandlerSmooth);
         }
         m_HandlerSmooth = FrameHandle.UF_AddCoroutine(UF_ISmoothOverFlow(insValue, duration, ingoreTimeScale, callback));
     }
     return(m_HandlerSmooth);
 }
Example #5
0
 public int UF_BounceColor(Color target, Color source, float duration, string colorName)
 {
     if (m_Avatar != null && m_Avatar.isActive)
     {
         return(FrameHandle.UF_AddCoroutine(UF_IBounceColor(target, source, duration, colorName)));
     }
     return(0);
 }
Example #6
0
 public int UF_BounceValue(float target, float source, float duration, string valueName)
 {
     if (m_Avatar != null && m_Avatar.isActive)
     {
         return(FrameHandle.UF_AddCoroutine(UF_IBounceValue(target, source, duration, valueName)));
     }
     return(0);
 }
Example #7
0
 public void UF_StopFillAmount()
 {
     if (m_HandleFillAmount != 0)
     {
         FrameHandle.UF_RemoveCouroutine(m_HandleFillAmount);
         m_HandleFillAmount = 0;
     }
 }
Example #8
0
 public int UF_SmoothVolume(float targetVolume, float duration)
 {
     if (targetVolume == m_Volume)
     {
         return(0);
     }
     return(FrameHandle.UF_AddCoroutine(UF_ISmoothVolume(targetVolume, duration)));
 }
Example #9
0
 //指定时间内自动释放
 public void UF_AutoRelease(float value)
 {
     if (m_CoAutoRelease != 0)
     {
         FrameHandle.UF_RemoveCouroutine(m_CoAutoRelease, true);
     }
     m_CoAutoRelease = FrameHandle.UF_AddCoroutine(UF_IAutoRelease(value), true);
 }
Example #10
0
 //Unity Message Event
 void OnApplicationPause(bool state)
 {
     FrameHandle.OnApplicationPause(state);
     if (state)
     {
         System.GC.Collect();
     }
 }
Example #11
0
 public void UF_StopSmooth()
 {
     if (m_HandlerSmooth != 0)
     {
         FrameHandle.UF_RemoveCouroutine(m_HandlerSmooth);
         m_HandlerSmooth = 0;
     }
 }
Example #12
0
 public static void UF_SafeCall(string method, string arg)
 {
     FrameHandle.UF_CallMethod(
         () => {
         VendorSDK.UF_Call(method, arg);
     }
         );
 }
Example #13
0
 public void Release()
 {
     //if (!isReleased)
     //    this.isActive = false;
     isReleased = true;
     FrameHandle.UF_RemoveCouroutine(m_TimeReleaseHandle);
     m_TimeReleaseHandle = 0;
 }
Example #14
0
        //Unity Message Event
        void Update()
        {
            GTime.Update();
            FrameHandle.UF_OnUpdate();
            FrameHandle.UF_OnSecondUpdate();

            MgobeHelper.Update();
        }
Example #15
0
 public int UF_SmoothFillAmount(float _from, float _to, float duration, bool ingoreTimeScale)
 {
     UF_StopFillAmount();
     if (this.gameObject.activeInHierarchy)
     {
         m_HandleFillAmount = FrameHandle.UF_AddCoroutine(UF_ISmoothToValue(_from, _to, duration, ingoreTimeScale));
     }
     return(m_HandleFillAmount);
 }
Example #16
0
 public override void UF_OnReset()
 {
     base.UF_OnReset();
     if (m_CoAutoRelease != 0)
     {
         FrameHandle.UF_RemoveCouroutine(m_CoAutoRelease);
     }
     m_CoAutoRelease = 0;
 }
Example #17
0
 public int UF_SmoothPlay(float duration, float startVolume = 0f)
 {
     this.UF_Play();
     if (startVolume < m_Volume && duration > 0)
     {
         return(FrameHandle.UF_AddCoroutine(UF_ISmoothPlay(duration, startVolume)));
     }
     return(0);
 }
Example #18
0
 public int UF_SmoothStop(float duration, float endVolume = 0f)
 {
     if (duration <= 0 || System.Math.Abs(endVolume - m_Volume) < 0.001f)
     {
         UF_Stop();
         return(0);
     }
     return(FrameHandle.UF_AddCoroutine(UF_ISmoothStop(duration, endVolume)));
 }
Example #19
0
 public void Stop()
 {
     if (m_MotionID != 0)
     {
         FrameHandle.UF_RemoveCouroutine(m_MotionID);
         m_MotionID = 0;
         if (target != null)
         {
             target.text = m_CacheText;
         }
     }
 }
Example #20
0
 private void UF_InvokCallback(DelegateResponse callback, int retcode, object param)
 {
     if (callback != null)
     {
         FrameHandle.UF_CallMethod(() => {
             if (callback != null)
             {
                 callback(retcode, param);
             }
         });
     }
 }
Example #21
0
 public int UF_SmoothGlobalVolume(float volume, float duration)
 {
     if (duration <= 0)
     {
         UF_SetGlobalVolume(volume);
         return(0);
     }
     else
     {
         return(FrameHandle.UF_AddCoroutine(UF_ISmoothGlobalVolume(volume, duration)));
     }
 }
Example #22
0
        public void UF_OnShow()
        {
            if (m_HandleClosing > 0)
            {
                FrameHandle.UF_RemoveCouroutine(m_HandleClosing);
                m_HandleClosing = 0;
            }
            this.UF_SetActive(true);

            UF_ApplyCanvasSortingOrder();

            UF_InvokeShowEvent();
        }
Example #23
0
        public void UF_OnClose()
        {
            //this.UF_SetActive (false);
            UF_InvokeCloseEvent();

            if (releaseDelay <= 0)
            {
                this.UF_OnReset();
                this.Release();
            }
            else
            {
                FrameHandle.UF_AddCoroutine(UF_IDelayRelease(releaseDelay));
            }
        }
Example #24
0
        public int UF_SmoothToPos(Vector2 pos, float duration)
        {
            if (this.content == null)
            {
                return(0);
            }
            if (duration == 0)
            {
                UF_SetToPos(pos);
                return(0);
            }
            Vector2 tpos = UF_FixVailPos(pos);
            Vector2 spos = this.content.anchoredPosition;

            return(FrameHandle.UF_AddCoroutine(UF_ISmoothToPos(spos, tpos, duration)));
        }
Example #25
0
        public int UF_AddScale(
            Transform target,
            Vector3 vfrom,
            Vector3 vto,
            float duration,
            bool ingoreTimeScale,
            DelegateVoid eventFinish)
        {
            int       id        = 0;
            Transform transform = UF_ObjectToTransform(target);

            if (transform != null)
            {
                id = FrameHandle.UF_AddCoroutine(UF_MotionScale(transform, vfrom, vto, duration, ingoreTimeScale, eventFinish));
            }
            return(id);
        }
Example #26
0
        void Awake()
        {
            try{
                DontDestroyOnLoad(this);
                s_GameMaim = this;
                s_Root     = this.gameObject;

                FrameHandle.UF_AddHandle(Debugger.UF_GetInstance());
                //System
                FrameHandle.UF_AddHandle(MessageSystem.UF_GetInstance());
                FrameHandle.UF_AddHandle(UpgradeSystem.UF_GetInstance());
                //FrameHandle.UF_AddHandle(NetworkSystem.UF_GetInstance());
                FrameHandle.UF_AddHandle(AssetSystem.UF_GetInstance());
                FrameHandle.UF_AddHandle(CEntitySystem.UF_GetInstance());
                //FrameHandle.UF_AddHandle(LuaFramework.UF_GetInstance());
                //manager
                FrameHandle.UF_AddHandle(PDataManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(ShaderManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(AudioManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(UIManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(FXManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(NavigateManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(MotionManager.UF_GetInstance());
                //FrameHandle.UF_AddHandle(PerformActionManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(RaycastManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(VoiceManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(RenderPreviewManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(RefObjectManager.UF_GetInstance());
                FrameHandle.UF_AddHandle(CheckPointManager.UF_GetInstance());

                FrameHandle.UF_AddHandle(SimulationManager.Instance);

                //setting
                GTime.FrameRate     = 60;
                GTime.FixedTimeRate = 0.016f;
                GTime.RunDeltaTime  = 0.016f;

                Screen.sleepTimeout = SleepTimeout.NeverSleep;
                VendorSDK.UF_Init();

                //VestBinder.Bind();
            }
            catch (System.Exception e) {
                Debugger.UF_Exception(e);
            }
        }
Example #27
0
        public int UF_AddEuler(
            UnityEngine.Object target,
            Vector3 vfrom,
            Vector3 vto,
            float duration,
            bool ingoreTimeScale,
            bool spaceWorld,
            DelegateVoid eventFinish)
        {
            int       id        = 0;
            Transform transform = UF_ObjectToTransform(target);

            if (transform != null)
            {
                id = FrameHandle.UF_AddCoroutine(UF_MotionEuler(transform, vfrom, vto, duration, ingoreTimeScale, spaceWorld, eventFinish));
            }
            return(id);
        }
Example #28
0
        protected override void UF_OnPlay(GameObject tar, Vector3 tarPos, Vector3 vecforward)
        {
            Vector3 sorPoint = this.position;

            //if (tar != null)
            //{
            //    vecforward = (tar.transform.position - sorPoint).normalized;
            //}
            //设置角度指向
            //this.euler = new Vector3(0, MathX.UF_EulerAngle(vecforward).y, 0);
            vecforward.y = 0;
            vecforward.Normalize();
            usePierceTimes  = 0;
            useReboundTimes = 0;
            //采用射线检测
            //通过射线方向计算反射位置
            //忽略子弹间的碰撞
            FrameHandle.UF_AddCoroutine(UF_IOnRayCastHit(sorPoint, vecforward), true);
        }
Example #29
0
 public int UF_SmoothSize(float size, float duration)
 {
     if (duration > 0)
     {
         if (this.gameObject.activeInHierarchy)
         {
             return(FrameHandle.UF_AddCoroutine(UF_ISmoothSize(camera, size, duration)));
         }
         else
         {
             camera.orthographicSize = size;
         }
     }
     else
     {
         UF_SetSize(size);
     }
     return(0);
 }
Example #30
0
        public int PlayWithCallback(float dura, DelegateMethod callback)
        {
            if (target == null || !target.gameObject.activeInHierarchy)
            {
                return(0);
            }

            if (isPlaying)
            {
                Stop();
            }

            //不支持富文本
            target.supportRichText = false;
            duration    = dura;
            m_CacheText = target.text;
            m_MotionID  = FrameHandle.UF_AddCoroutine(ITypewriterMotion(target, m_CacheText, callback));

            return(m_MotionID);
        }