本文整理汇总了C#中UnityEngine.UI.Windows.Plugins.Flow.Data.IsSmall方法的典型用法代码示例。如果您正苦于以下问题:C# Data.IsSmall方法的具体用法?C# Data.IsSmall怎么用?C# Data.IsSmall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.UI.Windows.Plugins.Flow.Data
的用法示例。
在下文中一共展示了Data.IsSmall方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawTransitionChooser
public void DrawTransitionChooser(AttachItem attach, FD.FlowWindow fromWindow, FD.FlowWindow toWindow, bool doubleSided) {
if (this.drawWindowContent == false) return;
if (toWindow.IsEnabled() == false) return;
if (toWindow.IsContainer() == true) return;
var factor = 0.5f;
var transitionsContainer = fromWindow;
var namePrefix = string.Empty;
if (fromWindow.IsSmall() == true &&
fromWindow.IsABTest() == true) {
// is ABTest
//Debug.Log(fromWindow.id + " => " + toWindow.id + " :: " + attach.index + " :: " + doubleSided);
transitionsContainer = FlowSystem.GetWindow(fromWindow.abTests.sourceWindowId);
if (transitionsContainer == null) return;
namePrefix = string.Format("Variant{0}", attach.index.ToString());
factor = 0.2f;
} else {
if (toWindow.IsSmall() == true) {
if (toWindow.IsFunction() == false) return;
}
}
if (FlowSystem.GetData().modeLayer == ModeLayer.Audio) {
if (FlowSystem.GetData().HasView(FlowView.AudioTransitions) == false) return;
} else {
if (FlowSystem.GetData().HasView(FlowView.VideoTransitions) == false) return;
}
const float size = 32f;
const float offset = size * 0.5f + 5f;
Vector2 centerOffset = Flow.OnDrawNodeCurveOffset(this, attach, fromWindow, toWindow, doubleSided);
if (doubleSided == true) {
var q = Quaternion.LookRotation(toWindow.rect.center - fromWindow.rect.center, Vector3.back);
var attachRevert = FlowSystem.GetAttachItem(toWindow.id, fromWindow.id);
this.DrawTransitionChooser(attachRevert, toWindow, toWindow, fromWindow, centerOffset, q * Vector2.left * offset, size, factor, namePrefix);
this.DrawTransitionChooser(attach, fromWindow, fromWindow, toWindow, centerOffset, q * Vector2.right * offset, size, factor, namePrefix);
} else {
this.DrawTransitionChooser(attach, transitionsContainer, fromWindow, toWindow, centerOffset, Vector2.zero, size, factor, namePrefix);
}
}
示例2: OnFlowWindowLayoutGUI
public override void OnFlowWindowLayoutGUI(Rect rect, FD.FlowWindow window) {
if (window.isVisibleState == false) return;
if (window.IsContainer() == true) return;
if (window.IsSmall() == true && window.IsFunction() == true) return;
if (window.IsShowDefault() == true) return;
if (Heatmap.settings == null) Heatmap.settings = Heatmap.GetSettingsFile();
var settings = Heatmap.settings;
if (settings != null) {
var data = settings.data.Get(window);
if (data == null) return;
LayoutWindowType screen;
var layout = HeatmapSystem.GetLayout(window.id, out screen);
if (layout == null) return;
var targetScreenSize = new Vector2(layout.root.editorRect.width, layout.root.editorRect.height);
foreach (var item in settings.items) {
if (item.show == true && item.enabled == true) {
foreach (var serviceBase in this.editor.services) {
var service = serviceBase as IAnalyticsService;
if (service.GetServiceName() == item.serviceName) {
var key = string.Format("{0}_{1}", item.serviceName, window.id);
HeatmapResult result;
if (this.heatmapResultsCache.TryGetValue(key, out result) == true) {
if (result != null) {
var texture = this.heatmapTexturesCache[key];
if (texture != null) {
var scaleFactor = HeatmapSystem.GetFactor(targetScreenSize, rect.size);
//var scaleFactorCanvas = layout.editorScale > 0f ? 1f / layout.editorScale : 1f;
//scaleFactor *= scaleFactorCanvas;
var r = layout.root.editorRect;
r.x *= scaleFactor;
r.y *= scaleFactor;
r.x += rect.x + rect.width * 0.5f;
r.y += rect.y + rect.height * 0.5f;
r.width *= scaleFactor;
r.height *= scaleFactor;
var c = Color.white;
GUI.color = c;
GUI.DrawTexture(r, texture, ScaleMode.StretchToFill, alphaBlend: true);
GUI.color = Color.white;
} else {
if (this.noDataTexture != null) GUI.DrawTexture(rect, this.noDataTexture, ScaleMode.ScaleToFit, alphaBlend: true);
}
} else {
// still loading...
}
} else {
if (Event.current.type == EventType.Repaint) {
var rectSize = targetScreenSize;//rect.size;
var rootRect = layout.root.editorRect;
this.heatmapResultsCache.Add(key, null);
this.heatmapTexturesCache.Add(key, null);
service.GetHeatmapData(window.id, (int)targetScreenSize.x, (int)targetScreenSize.y, item.userFilter, (_result) => {
var heatmapResult = _result as HeatmapResult;
// Convert normalized points to real points
for (int i = 0; i < heatmapResult.points.Length; ++i) {
var root = layout.GetRootByTag((LayoutTag)heatmapResult.points[i].tag);
if (root != null) {
var xn = heatmapResult.points[i].x;
var yn = heatmapResult.points[i].y;
var sourceRect = root.editorRect;
var radius = (float)HeatmapVisualizer.GetRadius();
sourceRect.x += radius;
sourceRect.y += radius;
sourceRect.width -= radius * 2f;
sourceRect.height -= radius * 2f;
var scaleFactor = HeatmapSystem.GetFactor(targetScreenSize, rectSize);
var r = sourceRect;
r.x *= scaleFactor;
r.y *= scaleFactor;
//.........这里部分代码省略.........
示例3: DrawWindowToolbar
//.........这里部分代码省略.........
}*/
} else {
if (GUILayout.Button(string.Format("Attach Here{0}", (Event.current.alt == true ? " (Double Direction)" : string.Empty)), buttonStyle) == true) {
FlowSystem.Attach(this.currentAttachId, this.currentAttachIndex, id, oneWay: Event.current.alt == false);
if (this.onAttach != null) this.onAttach(id, this.currentAttachIndex, true);
if (Event.current.shift == false) this.WaitForAttach(-1);
}
}
}
}
}
} else {
if (GUILayout.Button("Cancel", buttonStyle) == true) {
this.WaitForAttach(-1);
}
}
} else {
if (window.IsSmall() == false ||
window.IsFunction() == true ||
window.IsABTest() == true) {
if (GUILayout.Button("Attach/Detach", buttonStyle) == true) {
this.ShowNotification(new GUIContent("Use Attach/Detach buttons to Connect/Disconnect a window"));
this.WaitForAttach(id);
}
}
}
if (window.IsSmall() == false) {
//var isExit = false;
var functionWindow = window.GetFunctionContainer();
if (functionWindow != null) {
if (functionWindow.functionRootId == 0) functionWindow.functionRootId = id;
if (functionWindow.functionExitId == 0) functionWindow.functionExitId = id;
//isExit = (functionWindow.functionExitId == id);
}
var isRoot = (FlowSystem.GetRootWindow() == id || (functionWindow != null && functionWindow.functionRootId == id));
if (GUILayout.Toggle(isRoot, new GUIContent("R", "Set as root"), buttonStyle) != isRoot) {
if (functionWindow != null) {
示例4: OnFlowWindow
public override void OnFlowWindow(FD.FlowWindow window) {
if (window.isVisibleState == false) return;
if (window.IsContainer() == true) return;
if (window.IsSmall() == true && window.IsFunction() == true) return;
if (window.IsShowDefault() == true) return;
if (Heatmap.settings == null) Heatmap.settings = Heatmap.GetSettingsFile();
var settings = Heatmap.settings;
if (settings != null) {
var result = new ScreenResult();
foreach (var item in settings.items) {
if (item.show == true && item.enabled == true) {
foreach (var serviceBase in this.editor.services) {
var service = serviceBase as IAnalyticsService;
if (service.GetServiceName() == item.serviceName) {
var rect = window.rect;
this.DrawBubble(new Rect(new Vector2(rect.x + rect.width * 0.5f, rect.y), Vector2.zero), 0, window.id, -1, Vector2.zero, "LabelGreen");
int value;
var keyTransition = string.Format("{0}_{1}", item.serviceName, window.id);
if (this.resultsTransitionCache.TryGetValue(keyTransition, out value) == true) {
result.uniqueCount = value;
}
if (result.uniqueCount > 0 && result.popup == false) {
// Draw exit bubble
this.DrawBubble(new Vector2(rect.x + rect.width * 0.5f, rect.y + rect.height), result, Vector2.zero, "LabelRed", "{1}");
}
}
}
}
}
}
}
示例5: OnFlowWindowScreenMenuGUI
public override void OnFlowWindowScreenMenuGUI(FD.FlowWindow window, GenericMenu menu) {
if (window.isVisibleState == false) return;
if (window.IsContainer() == true) return;
if (window.IsSmall() == true && window.IsFunction() == true) return;
if (window.IsShowDefault() == true) return;
if (Heatmap.settings == null) Heatmap.settings = Heatmap.GetSettingsFile();
var settings = Heatmap.settings;
if (settings != null) {
var data = settings.data.Get(window);
if (data == null) return;
foreach (var item in settings.items) {
if (item.show == true && item.enabled == true) {
foreach (var serviceBase in this.editor.services) {
var service = serviceBase as IAnalyticsService;
if (service.GetServiceName() == item.serviceName) {
var key = string.Format("{0}_{1}", item.serviceName, window.id);
var windowId = window.id;
menu.AddItem(new GUIContent("Open Heatmap..."), false, () => {
//this.fullScreenData = this.heatmapResultsCache[key];
this.fullScreenTexture = this.heatmapTexturesCache[key];
this.fullScreenWindowId = windowId;
this.fullScreenEditor = null;
this.openFullScreen = true;
this.flowEditor.SetDisabled();
});
}
}
}
}
}
}
示例6: OnFlowWindowGUI
public override void OnFlowWindowGUI(FD.FlowWindow window) {
var data = FlowSystem.GetData();
if (data == null) return;
if (data.modeLayer == ModeLayer.Audio) {
if (window.IsContainer() == true ||
window.IsSmall() == true ||
window.IsShowDefault() == true)
return;
var screen = window.GetScreen();
if (screen != null) {
GUILayout.BeginHorizontal();
{
var playType = (int)screen.audio.playType;
playType = GUILayoutExt.Popup(playType, new string[2] { "Keep Current", "Restart If Equals" }, FlowSystemEditorWindow.defaultSkin.label, GUILayout.Width(EditorGUIUtility.labelWidth));
screen.audio.playType = (UnityEngine.UI.Windows.Audio.Window.PlayType)playType;
var rect = GUILayoutUtility.GetLastRect();
/*var newId = */AudioPopupEditor.Draw(new Rect(rect.x + rect.width, rect.y, window.rect.width - EditorGUIUtility.labelWidth - 10f, rect.height), screen.audio.id, (result) => {
screen.audio.id = result;
window.audioEditor = null;
}, screen.audio.clipType, screen.audio.flowData.audio, null);
/*if (newId != screen.audio.id) {
screen.audio.id = newId;
window.audioEditor = null;
}*/
}
GUILayout.EndHorizontal();
var state = data.audio.GetState(screen.audio.clipType, screen.audio.id);
if (state != null && state.clip != null) {
GUILayout.BeginVertical();
{
GUILayout.Box(string.Empty, FlowSystemEditorWindow.styles.layoutBoxStyle, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
var rect = GUILayoutUtility.GetLastRect();
if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition) == true) {
window.audioEditor = null;
}
if (window.audioEditor == null) {
EditorPrefs.SetBool("AutoPlayAudio", false);
window.audioEditor = Editor.CreateEditor(state.clip);
//System.Type.GetType("AudioUtil").InvokeMember("StopClip", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public, null, null, new object[] { state.clip });
}
if (Event.current.type != EventType.MouseDrag && Event.current.type != EventType.DragPerform) {
window.audioEditor.OnPreviewGUI(rect, EditorStyles.helpBox);
GUILayout.BeginHorizontal();
window.audioEditor.OnPreviewSettings();
GUILayout.EndHorizontal();
}
}
GUILayout.EndVertical();
}
}
}
}
示例7: OnFlowWindowTransition
public override void OnFlowWindowTransition(int index, FD.FlowWindow fromWindow, FD.FlowWindow toWindow, bool doubleSided, Vector2 centerOffset) {
var factor = 0.5f;
if (fromWindow.IsSmall() == true &&
fromWindow.IsABTest() == true) {
factor = 0.2f;
}
var point = Vector2.Lerp(fromWindow.rect.center, toWindow.rect.center, factor) + centerOffset;
var rect = new Rect(point, Vector2.zero);
if (this.flowEditor.ContainsRect(rect) == false) return;
if (doubleSided == true) {
var q = Quaternion.LookRotation(toWindow.rect.center - fromWindow.rect.center, Vector3.back);
this.DrawBubble(rect, index, fromWindow.id, toWindow.id, q * Vector2.left);
this.DrawBubble(rect, index, toWindow.id, fromWindow.id, q * Vector2.right);
} else {
this.DrawBubble(rect, index, fromWindow.id, toWindow.id, Vector2.zero);
}
}
示例8: DrawTransitionChooser
public void DrawTransitionChooser(FD.FlowWindow.AttachItem attach, FD.FlowWindow fromWindow, FD.FlowWindow toWindow, bool doubleSided) {
if (toWindow.IsEnabled() == false) return;
if (toWindow.IsContainer() == true) return;
if (toWindow.IsSmall() == true) {
if (toWindow.IsFunction() == false) return;
}
const float size = 32f;
const float offset = size * 0.5f + 5f;
if (doubleSided == true) {
var q = Quaternion.LookRotation(toWindow.rect.center - fromWindow.rect.center, Vector3.back);
var attachRevert = FlowSystem.GetAttachItem(toWindow.id, fromWindow.id);
this.DrawTransitionChooser(attachRevert, toWindow, fromWindow, q * Vector2.left * offset, size);
this.DrawTransitionChooser(attach, fromWindow, toWindow, q * Vector2.right * offset, size);
} else {
this.DrawTransitionChooser(attach, fromWindow, toWindow, Vector2.zero, size);
}
}
示例9: OnFlowWindowGUI
/*public override string OnCompilerTransitionTypedAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName, System.Type[] types, string[] names) {
if (windowTo.IsLinker() == true &&
windowTo.GetLinkerId() > 0) {
var result = string.Empty;
var window = FlowSystem.GetWindow(windowTo.GetLinkerId());
var className = window.directory;
var classNameWithNamespace = Tpl.GetNamespace(window) + "." + Tpl.GetDerivedClassName(window);
result += TemplateGenerator.GenerateWindowLayoutTransitionMethod(windowFrom, window, className, classNameWithNamespace);
WindowSystem.CollectCallVariations(windowTo.GetScreen(), (listTypes, listNames) => {
result += TemplateGenerator.GenerateWindowLayoutTransitionTypedMethod(windowFrom, window, className, classNameWithNamespace, listTypes, listNames);
});
Debug.Log(className + " :: " + classNameWithNamespace + " == " + result);
return result;
}
return base.OnCompilerTransitionTypedAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName, types, names);
}*/
public override void OnFlowWindowGUI(FD.FlowWindow window) {
var data = FlowSystem.GetData();
if (data == null) return;
var flag =
(window.IsLinker() == true &&
window.IsSmall() == true &&
window.IsContainer() == false);
if (flag == true) {
var alreadyConnectedFunctionIds = new List<int>();
// Find caller window
var windowFrom = data.windowAssets.FirstOrDefault((item) => item.HasAttach(window.id));
if (windowFrom != null) {
var attaches = windowFrom.GetAttachedWindows();
foreach (var attachWindow in attaches) {
if (attachWindow.IsLinker() == true) {
alreadyConnectedFunctionIds.Add(attachWindow.GetLinkerId());
}
}
}
foreach (var win in data.windowAssets) {
if (win.CanDirectCall() == true) {
var count = alreadyConnectedFunctionIds.Count((e) => e == win.id);
if ((window.GetLinkerId() == win.id && count == 1) || count == 0) {
} else {
if (win.id == window.GetLinkerId()) window.linkerId = 0;
alreadyConnectedFunctionIds.Remove(win.id);
}
}
}
var linkerId = window.GetLinkerId();
var linker = linkerId == 0 ? null : data.GetWindow(linkerId);
var isActiveSelected = true;
var oldColor = GUI.color;
GUI.color = isActiveSelected ? Color.white : Color.grey;
var result = GUILayout.Button(linker != null ? linker.title : "None", FlowSystemEditorWindow.defaultSkin.button, GUILayout.ExpandHeight(true));
GUI.color = oldColor;
var rect = GUILayoutUtility.GetLastRect();
rect.y += rect.height;
if (result == true) {
var menu = new GenericMenu();
menu.AddItem(new GUIContent("None"), window.linkerId == 0, () => {
window.linkerId = 0;
});
if (windowFrom != null) {
//.........这里部分代码省略.........
示例10: OnCompilerTransitionAttachedGeneration
public override string OnCompilerTransitionAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName) {
if (windowTo.IsABTest() == true &&
windowTo.IsSmall() == true) {
return FlowABTestingTemplateGenerator.GenerateTransitionMethod(this.flowEditor, windowFrom, windowTo);
}
return base.OnCompilerTransitionAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName);
}
示例11: OnCompilerTransitionTypedAttachedGeneration
public override string OnCompilerTransitionTypedAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName, System.Type[] types, string[] names) {
if (windowTo.IsFunction() == true &&
windowTo.IsSmall() == true &&
windowTo.IsContainer() == false &&
windowTo.GetFunctionId() > 0) {
return FlowFunctionsTemplateGenerator.GenerateTransitionTypedMethod(this.flowEditor, windowFrom, windowTo, types, names);
}
return base.OnCompilerTransitionTypedAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName, types, names);
}
示例12: IsCompilerTransitionAttachedGeneration
public override bool IsCompilerTransitionAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo) {
return windowTo.IsFunction() == true &&
windowTo.IsSmall() == true &&
windowTo.IsContainer() == false &&
windowTo.GetFunctionId() > 0;
}