Compare commits
No commits in common. "faa1a9d1b6ff94292ba73adab6c8f64720d46734" and "941178cf580a76ed400f50172397ded9e521d170" have entirely different histories.
faa1a9d1b6
...
941178cf58
@ -29,7 +29,6 @@ public class UIToolsAction : IAction
|
|||||||
string random;
|
string random;
|
||||||
string scrollSpeed;
|
string scrollSpeed;
|
||||||
string position;
|
string position;
|
||||||
string wrongCount;
|
|
||||||
public static UIToolsAction Allocate(Dictionary<string, string> datas, System.Action onDelayFinish = null)
|
public static UIToolsAction Allocate(Dictionary<string, string> datas, System.Action onDelayFinish = null)
|
||||||
{
|
{
|
||||||
var retNode = mPool.Allocate();
|
var retNode = mPool.Allocate();
|
||||||
@ -51,7 +50,6 @@ public class UIToolsAction : IAction
|
|||||||
retNode.random = datas.ContainsKey("random") ? datas["random"] : "";
|
retNode.random = datas.ContainsKey("random") ? datas["random"] : "";
|
||||||
retNode.scrollSpeed = datas.ContainsKey("scrollSpeed") ? datas["scrollSpeed"] : "";
|
retNode.scrollSpeed = datas.ContainsKey("scrollSpeed") ? datas["scrollSpeed"] : "";
|
||||||
retNode.position = datas.ContainsKey("position") ? datas["position"] : "";
|
retNode.position = datas.ContainsKey("position") ? datas["position"] : "";
|
||||||
retNode.wrongCount = datas.ContainsKey("wrongCount") ? datas["wrongCount"] : "";
|
|
||||||
return retNode;
|
return retNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,11 +100,6 @@ public class UIToolsAction : IAction
|
|||||||
data.autoHideResult = -1;
|
data.autoHideResult = -1;
|
||||||
}
|
}
|
||||||
data.position = position;
|
data.position = position;
|
||||||
if (int.TryParse(wrongCount, out data.wrongCount) == false)
|
|
||||||
{
|
|
||||||
data.wrongCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
UIKit.OpenPanelAsync<UITools>(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish());
|
UIKit.OpenPanelAsync<UITools>(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,13 +26,11 @@ namespace QFramework.Example
|
|||||||
public bool random = false;
|
public bool random = false;
|
||||||
public float scrollSpeed = 25;
|
public float scrollSpeed = 25;
|
||||||
public string position;
|
public string position;
|
||||||
public int wrongCount = 0;
|
|
||||||
}
|
}
|
||||||
public partial class UITools : UIPanel
|
public partial class UITools : UIPanel
|
||||||
{
|
{
|
||||||
ResLoader mResLoader;
|
ResLoader mResLoader;
|
||||||
public List<string> answers;
|
public List<string> answers;
|
||||||
int curWrongCount = 0;
|
|
||||||
protected override void OnInit(IUIData uiData = null)
|
protected override void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
mData = uiData as UIToolsData ?? new UIToolsData();
|
mData = uiData as UIToolsData ?? new UIToolsData();
|
||||||
@ -49,7 +47,6 @@ namespace QFramework.Example
|
|||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
mData = uiData as UIToolsData ?? new UIToolsData();
|
mData = uiData as UIToolsData ?? new UIToolsData();
|
||||||
curWrongCount = 0;
|
|
||||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
|
||||||
if (mData.totalScore > 0)
|
if (mData.totalScore > 0)
|
||||||
{
|
{
|
||||||
@ -93,7 +90,6 @@ namespace QFramework.Example
|
|||||||
Button btn = obj.GetComponent<Button>();
|
Button btn = obj.GetComponent<Button>();
|
||||||
btn.onClick.AddListener(() =>
|
btn.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
if (answers != null)
|
if (answers != null)
|
||||||
{
|
{
|
||||||
if (answers.Contains(item.Name))
|
if (answers.Contains(item.Name))
|
||||||
@ -126,10 +122,7 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(mData.rightEvent) == false)
|
if (string.IsNullOrEmpty(mData.rightEvent) == false)
|
||||||
{
|
{
|
||||||
if (curWrongCount >= mData.wrongCount)
|
StringEventSystem.Global.Send(mData.rightEvent);
|
||||||
{
|
|
||||||
StringEventSystem.Global.Send(mData.rightEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,10 +140,7 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
if (string.IsNullOrEmpty(mData.wrongEvent) == false)
|
if (string.IsNullOrEmpty(mData.wrongEvent) == false)
|
||||||
{
|
{
|
||||||
if (curWrongCount >= mData.wrongCount)
|
StringEventSystem.Global.Send(mData.wrongEvent);
|
||||||
{
|
|
||||||
StringEventSystem.Global.Send(mData.wrongEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SetSelected(obj, false);
|
SetSelected(obj, false);
|
||||||
};
|
};
|
||||||
@ -161,17 +151,14 @@ namespace QFramework.Example
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(mData.wrongEvent) == false)
|
if (string.IsNullOrEmpty(mData.wrongEvent) == false)
|
||||||
{
|
{
|
||||||
if (curWrongCount >= mData.wrongCount)
|
StringEventSystem.Global.Send(mData.wrongEvent);
|
||||||
{
|
|
||||||
StringEventSystem.Global.Send(mData.wrongEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SetSelected(obj, false);
|
SetSelected(obj, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.curWrongCount++;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
mResLoader.LoadAsync();
|
mResLoader.LoadAsync();
|
||||||
|
|||||||
@ -592,11 +592,6 @@ namespace XMLTool
|
|||||||
{
|
{
|
||||||
act.args.Add("position", position.Value);
|
act.args.Add("position", position.Value);
|
||||||
}
|
}
|
||||||
var wrongCount = action.Attribute("wrongCount");
|
|
||||||
if (wrongCount != null)
|
|
||||||
{
|
|
||||||
act.args.Add("wrongCount", wrongCount.Value);
|
|
||||||
}
|
|
||||||
newAction = act;
|
newAction = act;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -37,8 +37,7 @@
|
|||||||
totalScore 是配合wrongScore的用于初始化一个分数 然后选择扣分
|
totalScore 是配合wrongScore的用于初始化一个分数 然后选择扣分
|
||||||
random 是否打乱devices的顺序
|
random 是否打乱devices的顺序
|
||||||
scrollSpeed 鼠标滚轮的滑动速度
|
scrollSpeed 鼠标滚轮的滑动速度
|
||||||
position left/right 可以让道具栏在左侧或者右侧
|
position left/right 可以让道具栏在左侧或者右侧-->
|
||||||
errorCount 错误的次数 不为0的情况下 大于这个次数才会触发WrongScore-->
|
|
||||||
<Action type="UITools" devices="道具名字1" answers="正确道具"
|
<Action type="UITools" devices="道具名字1" answers="正确道具"
|
||||||
setActive="true"
|
setActive="true"
|
||||||
rightLabel="提示:器械选择正确。"
|
rightLabel="提示:器械选择正确。"
|
||||||
@ -52,8 +51,7 @@
|
|||||||
autoHide="-1"
|
autoHide="-1"
|
||||||
random="true"
|
random="true"
|
||||||
scrollSpeed="25"
|
scrollSpeed="25"
|
||||||
position="right"
|
position="right"></Action>
|
||||||
wrongCount="0"></Action>
|
|
||||||
|
|
||||||
<!--道具背包,用于配合状态机进行道具的使用 目前是初步版本,仅支持配合UIClick点击,暂无道具数量等功能 详细参数可参考UITools-->
|
<!--道具背包,用于配合状态机进行道具的使用 目前是初步版本,仅支持配合UIClick点击,暂无道具数量等功能 详细参数可参考UITools-->
|
||||||
<Action type="UIBackPack" devices="道具名字1"
|
<Action type="UIBackPack" devices="道具名字1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user