本文整理汇总了C#中ISelectable.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ISelectable.ToString方法的具体用法?C# ISelectable.ToString怎么用?C# ISelectable.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISelectable
的用法示例。
在下文中一共展示了ISelectable.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetSelected
public void SetSelected(ISelectable item) {
if ( !items.Contains(item)) return;
selectedItem = item;
foreach(ISelectable i in items) {
if (i != item) {
i.SetSelected(false);
}
}
Debug.Log(string.Format("ISelectable `{0}' was selected.",item.ToString()));
}
示例2: Info_SetSelcectedObject
public void Info_SetSelcectedObject(ISelectable obj)
{
var preview = selectedObject as IPreviewable;
if (preview != null) preview.PreviewDeactive();
if (selectedObjectControls.Count > 0)
{
for (int i = selectedObjectControls.Count - 1; i >= 0; --i)
{
RemoveControl(selectedObjectControls[i]);
}
selectedObjectControls.Clear();
}
selectedObject = obj;
if (selectedObject != null)
{
{
var str = string.Format("{0}({1})", selectedObject.NameInObjectList, selectedObject.GetType().Name);
var label = new SelectionTargetHeader(str);
AddControl(label);
selectedObjectControls.Add(label);
}
var controls = selectedObject.Controls;
if (controls != null)
{
for (int i = 0; i < controls.Length; ++i)
{
AddControl(controls[i]);
selectedObjectControls.Add(controls[i]);
}
}
else
{
var c = new Label("Warning", () => "Selected object don't have any control.(" + obj.ToString() + ")");
AddControl(c);
selectedObjectControls.Add(c);
}
}
preview = selectedObject as IPreviewable;
if (preview != null) preview.PreviewActive();
}