本文整理汇总了C#中UnityEngine.Object.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Object.Equals方法的具体用法?C# Object.Equals怎么用?C# Object.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Object
的用法示例。
在下文中一共展示了Object.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getOpRepresentation
/**
* Gets the operation representation from an operation name
*
* @param ope
* the name of the operation
* @return the representation of the operation
*/
public static string getOpRepresentation(Object ope)
{
string op = string.Empty;
if (ope.Equals(EQUALS))
{
op = "=";
}
else if (ope.Equals(GRATER))
{
op = ">";
}
else if (ope.Equals(LESS))
{
op = "<";
}
else if (ope.Equals(GRATER_EQ))
{
op = ">=";
}
else if (ope.Equals(LESS_EQ))
{
op = "<=";
}
return op;
}
示例2: Retain
/// <summary>
/// 增加引用
/// </summary>
/// <param name="owner">用来计算引用计数,如果所有的引用对象被销毁了,那么AB也将会被销毁</param>
public void Retain(Object owner)
{
if (owner == null)
throw new Exception("Please set the user!");
for (int i = 0; i < references.Count; i++)
{
if (owner.Equals(references[i].Target))
return;
}
WeakReference wr = new WeakReference(owner);
references.Add(wr);
}
示例3: getOpName
/**
* Gets the operation name from an operation representation
*
* @param ope
* the representation of the operation
* @return the name of the operation
*/
public static string getOpName(Object ope)
{
string op = string.Empty;
if (ope.Equals("="))
{
op = EQUALS;
}
else if (ope.Equals(">"))
{
op = GRATER;
}
else if (ope.Equals("<"))
{
op = LESS;
}
else if (ope.Equals(">="))
{
op = GRATER_EQ;
}
else if (ope.Equals("<="))
{
op = LESS_EQ;
}
return op;
}