Merge remote-tracking branch 'origin/master' into LouDi_Pig
This commit is contained in:
commit
30188c0a5b
@ -65,55 +65,61 @@ namespace QFramework
|
|||||||
if (obj.activeSelf == false)
|
if (obj.activeSelf == false)
|
||||||
{
|
{
|
||||||
Debug.LogError(obj.name + "µ±Ç°ÊÇÒþ²Ø×´Ì¬");
|
Debug.LogError(obj.name + "µ±Ç°ÊÇÒþ²Ø×´Ì¬");
|
||||||
|
this.Finish();
|
||||||
}
|
}
|
||||||
try
|
else
|
||||||
{
|
{
|
||||||
anim = obj.GetComponent<Animation>();
|
try
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(frame) == false && frame != "-1")
|
|
||||||
{
|
{
|
||||||
int curFrame = 0;
|
anim = obj.GetComponent<Animation>();
|
||||||
int.TryParse(frame, out curFrame);
|
|
||||||
anim.clip = anim[animName].clip;
|
|
||||||
anim[animName].time = curFrame / anim.clip.frameRate;
|
|
||||||
anim[animName].speed = 0;
|
|
||||||
anim.Play(animName);
|
|
||||||
this.Finish();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float curSpeed = 1;
|
|
||||||
if (string.IsNullOrEmpty(speed) == false)
|
|
||||||
{
|
|
||||||
float.TryParse(speed, out curSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (curSpeed < 0)
|
if (string.IsNullOrEmpty(frame) == false && frame != "-1")
|
||||||
{
|
{
|
||||||
|
int curFrame = 0;
|
||||||
|
int.TryParse(frame, out curFrame);
|
||||||
|
anim.clip = anim[animName].clip;
|
||||||
|
anim[animName].time = curFrame / anim.clip.frameRate;
|
||||||
|
anim[animName].speed = 0;
|
||||||
anim.Play(animName);
|
anim.Play(animName);
|
||||||
anim[animName].normalizedTime = 1;
|
this.Finish();
|
||||||
animDot = DOTween.To(() => anim[animName].normalizedTime, v => anim[animName].normalizedTime = v, 0, anim[animName].length / Math.Abs(curSpeed));
|
|
||||||
animDot.onComplete = () =>
|
|
||||||
{
|
|
||||||
anim.Stop();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
anim[animName].speed = curSpeed;
|
float curSpeed = 1;
|
||||||
anim.Play(animName);
|
if (string.IsNullOrEmpty(speed) == false)
|
||||||
if (anim[animName].wrapMode == WrapMode.Loop)
|
|
||||||
{
|
{
|
||||||
this.Finish();
|
float.TryParse(speed, out curSpeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (curSpeed < 0)
|
||||||
|
{
|
||||||
|
anim.Play(animName);
|
||||||
|
anim[animName].normalizedTime = 1;
|
||||||
|
animDot = DOTween.To(() => anim[animName].normalizedTime, v => anim[animName].normalizedTime = v, 0, anim[animName].length / Math.Abs(curSpeed));
|
||||||
|
animDot.onComplete = () =>
|
||||||
|
{
|
||||||
|
anim.Stop();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
anim[animName].speed = curSpeed;
|
||||||
|
anim.Play(animName);
|
||||||
|
if (anim[animName].wrapMode == WrapMode.Loop)
|
||||||
|
{
|
||||||
|
this.Finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
totalTime = Math.Abs(anim[animName].length / curSpeed);
|
||||||
}
|
}
|
||||||
totalTime = Math.Abs(anim[animName].length / curSpeed);
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
anim = obj.GetComponent<Animation>();
|
||||||
|
Debug.LogError($"{path} ²¥·Å¶¯» {animName} ³ö´í");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
Debug.LogError($"{path} ²¥·Å¶¯» {animName} ³ö´í");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -151,7 +157,10 @@ namespace QFramework
|
|||||||
{
|
{
|
||||||
if (obj != null)
|
if (obj != null)
|
||||||
{
|
{
|
||||||
anim?.Stop();
|
if (anim!=null)
|
||||||
|
{
|
||||||
|
anim.Stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
animDot?.Kill();
|
animDot?.Kill();
|
||||||
OnFinished = null;
|
OnFinished = null;
|
||||||
|
|||||||
@ -96,9 +96,6 @@ public class ScoreController : MonoSingleton<ScoreController>
|
|||||||
|
|
||||||
private void OnQuit(OnModuleQuit quit)
|
private void OnQuit(OnModuleQuit quit)
|
||||||
{
|
{
|
||||||
var data = moduleDict[Global.Instance.curModule.ModuleName];
|
|
||||||
var scoreDict = data.scoreDict;
|
|
||||||
scoreDict.Clear();
|
|
||||||
TypeEventSystem.Global.UnRegister<OnModuleStart>(OnStart);
|
TypeEventSystem.Global.UnRegister<OnModuleStart>(OnStart);
|
||||||
TypeEventSystem.Global.UnRegister<OnModuleQuit>(OnQuit);
|
TypeEventSystem.Global.UnRegister<OnModuleQuit>(OnQuit);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class Point3DItem : MonoBehaviour
|
|||||||
}
|
}
|
||||||
rotSpeed = data.rotateSpeed;
|
rotSpeed = data.rotateSpeed;
|
||||||
gameObject.GetComponent<SpriteRenderer>().sortingOrder = data.order;
|
gameObject.GetComponent<SpriteRenderer>().sortingOrder = data.order;
|
||||||
TypeEventSystem.Global.Register<OnPoint3DQuestionDestroy>(OnObjDestroy).UnRegisterWhenGameObjectDestroyed(gameObject);
|
TypeEventSystem.Global.Register<OnPoint3DQuestionDestroy>(OnObjDestroy);
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -49,8 +49,16 @@ public class Point3DItem : MonoBehaviour
|
|||||||
|
|
||||||
private void OnObjDestroy(OnPoint3DQuestionDestroy destroy)
|
private void OnObjDestroy(OnPoint3DQuestionDestroy destroy)
|
||||||
{
|
{
|
||||||
|
if (gameObject != null)
|
||||||
|
{
|
||||||
|
GameObject.Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
|
||||||
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
|
TypeEventSystem.Global.UnRegister<StepStatusOnChange>(OnStepChanged);
|
||||||
GameObject.Destroy(gameObject);
|
TypeEventSystem.Global.UnRegister<OnPoint3DQuestionDestroy>(OnObjDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMouseUpAsButton()
|
private void OnMouseUpAsButton()
|
||||||
|
|||||||
@ -15,9 +15,11 @@ namespace QFramework.Example
|
|||||||
mData = uiData as UISettingData ?? new UISettingData();
|
mData = uiData as UISettingData ?? new UISettingData();
|
||||||
|
|
||||||
AudioKit.Settings.MusicVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
|
AudioKit.Settings.MusicVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
|
AudioKit.Settings.VoiceVolume.RegisterWithInitValue(v => VoiceSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
VoiceSlider.onValueChanged.AddListener(volume =>
|
VoiceSlider.onValueChanged.AddListener(volume =>
|
||||||
{
|
{
|
||||||
AudioKit.Settings.MusicVolume.Value = volume;
|
AudioKit.Settings.MusicVolume.Value = volume;
|
||||||
|
AudioKit.Settings.VoiceVolume.Value = volume;
|
||||||
});
|
});
|
||||||
|
|
||||||
Global.appSetting.MouseMoveSpeed.RegisterWithInitValue(v => MouseSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
|
Global.appSetting.MouseMoveSpeed.RegisterWithInitValue(v => MouseSlider.value = v).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
@ -48,6 +50,10 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
AudioKit.Settings.MusicVolume.Value += value;
|
AudioKit.Settings.MusicVolume.Value += value;
|
||||||
}
|
}
|
||||||
|
if (AudioKit.Settings.VoiceVolume.Value > 0.1f && AudioKit.Settings.VoiceVolume.Value < 1f)
|
||||||
|
{
|
||||||
|
AudioKit.Settings.VoiceVolume.Value += value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user