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); }
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); } } }
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); }
//指定时间内自动释放 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); }
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); }
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); }
public int UF_SmoothVolume(float targetVolume, float duration) { if (targetVolume == m_Volume) { return(0); } return(FrameHandle.UF_AddCoroutine(UF_ISmoothVolume(targetVolume, duration))); }
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); }
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); }
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))); }
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))); } }
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)); } }
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))); }
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); }
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); }
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); }
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); }
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); }
public int UF_AddPathPoint( UnityEngine.Object target, List <Vector3> pathPoints, float duration, bool ingoreTimeScale, float heightOffset, bool spaceWorld, Vector3 offset, bool focusAngle, DelegateVoid eventFinish) { int id = 0; Transform transform = UF_ObjectToTransform(target); if (transform != null) { id = FrameHandle.UF_AddCoroutine(UF_MotionPathPoint(transform, pathPoints, duration, ingoreTimeScale, heightOffset, spaceWorld, offset, focusAngle, eventFinish)); } return(id); }
public int UF_AddTransPostion( UnityEngine.Object target, Vector3 vfrom, UnityEngine.Object toObject, float duration, 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) { id = FrameHandle.UF_AddCoroutine(UF_MotionTransPosition(transform, vfrom, tarTransform, duration, ingoreTimeScale, heightOffset, spaceWorld, offset, focusAngle, eventFinish)); } return(id); }
public int UF_AsyncLoadObjectImage(string name, DelegateObject callback) { return(FrameHandle.UF_AddCoroutine(UF_IAsyncLoadObjectImage(name, callback))); }
//定时释放 public void UF_TimedRelease(float time) { m_TimeReleaseHandle = FrameHandle.UF_AddCoroutine(UF_ITimedRelease(time)); }
public static int UF_CrossRenderAlpha(GameObject target, float vfrom, float vto, float duration, bool ingoreTimeScale) { return(FrameHandle.UF_AddCoroutine(UF_ICrossRenderAlpha(target, vfrom, vto, duration, ingoreTimeScale))); }
public static int UF_CrossColor(GameObject target, Color vfrom, Color vto, float duration, bool ingoreTimeScale) { return(FrameHandle.UF_AddCoroutine(UF_ICrossColor(target, vfrom, vto, duration, ingoreTimeScale))); }
public int UF_LoadTextureFromCacheOrDownload(string url, DelegateTexture methodCallback) { //解析出名字 string fileName = Path.GetFileNameWithoutExtension(url); string localfile = GlobalPath.TexturePath + fileName; //指定的url图片名字转化为本地图片名字 bool isWebToLocal = false; if (string.IsNullOrEmpty(fileName)) { return(0); } if (methodCallback == null) { Debug.LogWarning("LoadTextureFromCacheOrDownload with Not Callback, Invoke Method Failed"); return(0); } if (m_DicMapWebTextureToLocal.ContainsKey(fileName)) { fileName = m_DicMapWebTextureToLocal [fileName]; isWebToLocal = true; } var tex = RefObjectManager.UF_GetInstance().UF_LoadRefObject <Texture2D>(fileName, false) as Texture2D; if (tex != null) { if (methodCallback != null) { methodCallback(tex); } return(0); } if (isWebToLocal) { Texture2D image = UF_LoadTexture(fileName); if (image == null) { image = UF_LoadTextureLocal(GlobalPath.TexturePath + fileName); } if (methodCallback != null) { methodCallback(image); } return(0); } //检查本地是否存在缓存图片 if (File.Exists(localfile)) { // Debug.Log ("load form Cache:" + localfile); Texture2D t2d = UF_LoadTextureLocal(localfile); if (methodCallback != null) { methodCallback(t2d); } return(0); } else { // Debug.Log ("load form Web:" + url); if (!m_DicWebTextureRequeset.ContainsKey(fileName)) { m_DicWebTextureRequeset.Add(fileName, methodCallback); } else { m_DicWebTextureRequeset[fileName] += methodCallback; } return(FrameHandle.UF_AddCoroutine(UF_ILoadTextureFormWeb(url))); } }
public void UF_OnStart() { FrameHandle.UF_AddCoroutine(UF_ICoOnStart()); }