本文整理汇总了C#中Point.GetUni方法的典型用法代码示例。如果您正苦于以下问题:C# Point.GetUni方法的具体用法?C# Point.GetUni怎么用?C# Point.GetUni使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point.GetUni方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteLine
public void DeleteLine(Point p1,Point p2)
{
DeleteLine(p1.GetUni(), p2.GetUni());
}
示例2: Link
public void Link(GameObject crystal)
{
if (crystal != null)//水晶连线 && linkStop == false
{
if (!draw)//如果还没开始画线
{
//if (EnergyManager.Instance.accessibleEnergy > 0)
{
#region
float x = 0, z = 0; int kx = -1, ky = -1;
linePoints = new Vector3[2];
linePoints[0] = crystal.transform.position;
z = EnergyManager.Instance.HeroMagicCircle.getz(linePoints[0].z);
if (z == EnergyManager.Instance.HeroMagicCircle.rowKey[2])
x = EnergyManager.Instance.HeroMagicCircle.getx1(linePoints[0].x);
else if (z == EnergyManager.Instance.HeroMagicCircle.rowKey[0] || z == EnergyManager.Instance.HeroMagicCircle.rowKey[4])
x = EnergyManager.Instance.HeroMagicCircle.getx2(linePoints[0].x);
else
x = EnergyManager.Instance.HeroMagicCircle.getx3(linePoints[0].x);
kx = EnergyManager.Instance.HeroMagicCircle.getKx(x);
ky = EnergyManager.Instance.HeroMagicCircle.getKy(z);
if (kx != -1)
{
l1 = new Point( kx , ky);
draw = true;
//EnergyManager.Instance.MinusEnergy(1);
}
screenSpace = Camera.main.WorldToScreenPoint(crystal.transform.position);
linePoints[1] = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenSpace.z));
temp1 = new VectorLine("3DLine", linePoints, Color.green, lineMaterial, 8.0f);
temp2 = new VectorLine("3DLine", linePoints, Color.green, lineMaterial2, 15.0f);
temp1.Draw3DAuto();
temp2.Draw3DAuto();
#endregion
}
//else
//{
// //linkStop = true;
//}
}
else
{
#region
float x = 0, z = 0; int kx = -1, ky = -1;
linePoints[1] = crystal.transform.position;
z = EnergyManager.Instance.HeroMagicCircle.getz(linePoints[1].z);
if (z == EnergyManager.Instance.HeroMagicCircle.rowKey[2])
x = EnergyManager.Instance.HeroMagicCircle.getx1(linePoints[1].x);
else if (z == EnergyManager.Instance.HeroMagicCircle.rowKey[0] || z == EnergyManager.Instance.HeroMagicCircle.rowKey[4])
x = EnergyManager.Instance.HeroMagicCircle.getx2(linePoints[1].x);
else
x = EnergyManager.Instance.HeroMagicCircle.getx3(linePoints[1].x);
kx = EnergyManager.Instance.HeroMagicCircle.getKx(x);
ky = EnergyManager.Instance.HeroMagicCircle.getKy(z);
l2 = new Point(kx , ky);
if (l2 == l1)//连自己=>取消连线
{
VectorLine.Destroy(ref temp1);
VectorLine.Destroy(ref temp2);
//EnergyManager.Instance.MinusEnergy(-1);
}
else if (EnergyManager.Instance.HeroMagicCircle.IsOperable(new Line(l1,l2)))
{
if (kx != -1 && !EnergyManager.Instance.HeroMagicCircle.GetLine(l1, l2) && EnergyManager.Instance.HeroMagicCircle.GetLineSwitch(l1.GetX(), l1.GetY(), l2.GetX(), l2.GetY()))//画线
{
//AddLine(l1, l2);
if (EnergyManager.Instance.accessibleEnergy>0)
{
temp1.Draw3D();
temp2.Draw3D();
line[l1.GetUni(), l2.GetUni()] = temp1; line2[l1.GetUni(), l2.GetUni()] = temp2;
EnergyManager.Instance.HeroMagicCircle.LineTrue(l1.GetUni(), l2.GetUni());
EnergyManager.Instance.MinusEnergy(1);
}
else
{
VectorLine.Destroy(ref temp1);
VectorLine.Destroy(ref temp2);
GuideText.Instance.ReturnText("LinkNeedEnergy");
}
}
else if (EnergyManager.Instance.HeroMagicCircle.GetLine(l1, l2))//删线
{
// Debug.Log("delete");
DeleteLine(l1, l2);
VectorLine.Destroy(ref temp1);
VectorLine.Destroy(ref temp2);
GuideText.Instance.GuideLevel(2, 33, "RedundentLink");
GuideText.Instance.GuideLevel(3, 33, "RedundentLink");
//EnergyManager.Instance.MinusEnergy(-1);
//linkStop = true;
}
}
else
{
GuideText.Instance.ReturnText("NoJumpLink");
return;
}
draw = false;
//.........这里部分代码省略.........
示例3: patternCreate
void patternCreate(List<int[]> Pattern)
{
Point point1, point2;
for (int i = 0; i < Pattern.Count; i++)
{
point1 = new Point(Pattern[i][0], Pattern[i][1]);
point2 = new Point(Pattern[i][2], Pattern[i][3]);
if ( isHeros &&!EnergyManager.Instance.HeroMagicCircle.GetLine(point1, point2))
{
//Debug.Log("pattenCreate"+Pattern[i][0].ToString() + "+" + Pattern[i][1].ToString() + "+" + Pattern[i][2].ToString() + "+" + Pattern[i][3].ToString());
RayTest.Instance.AddLine(point1.GetUni(), point2.GetUni());
}
if(!isHeros && !EnergyManager.Instance.EnemyMagicCircle.GetLine(point1,point2))
{
EnergyManager.Instance.EnemyMagicCircle.LineTrue(point1.GetUni(), point2.GetUni());
}
}
}
示例4: GetLine
/// <summary>
/// 取得Line(x,y)的值
/// </summary>
public bool GetLine(Point p1,Point p2)
{
return line[p1.GetUni(), p2.GetUni()];
}
示例5: patternDel
void patternDel(List<int[]> Pattern)
{
Point point1, point2;
for (int i = 0; i < Pattern.Count; i++)
{
point1 = new Point(Pattern[i][0], Pattern[i][1]);
point2 = new Point(Pattern[i][2], Pattern[i][3]);
//Debug.Log("pattenDel" + Pattern[i][0].ToString() + "+" + Pattern[i][1].ToString() + "+" + Pattern[i][2].ToString() + "+" + Pattern[i][3].ToString());
if (isHeros)
RayTest.Instance.DeleteLine(point1, point2);
else
EnergyManager.Instance.EnemyMagicCircle.DeleteLine(point1.GetUni(), point2.GetUni());
}
}