当前位置: 首页>>代码示例>>C#>>正文


C# VectorLine.SetColors方法代码示例

本文整理汇总了C#中VectorLine.SetColors方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLine.SetColors方法的具体用法?C# VectorLine.SetColors怎么用?C# VectorLine.SetColors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VectorLine的用法示例。


在下文中一共展示了VectorLine.SetColors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowMoveTrek

 void ShowMoveTrek()
 {
     if (ShipType != eShipType.Enemy)//仅敌人显示轨迹
         return;
     if (Speed.magnitude < float.Epsilon)
         return;
     Vector3 targetPos = new Vector3 (Speed.x,Speed.y,0);
     targetPos.Normalize ();
     if (FireLine == null) {
         Vector3 [] _points = new Vector3[6];
         for(int i=0;i<6;++i)
         {
             _points[i]=new Vector3(pMain.AimLineScale*0.1f*i,0,0);
         }
         Color []  _color = new Color[5];
         _color[0] = Color.red;
         _color[1] = Color.yellow;
         _color[2] = Color.green;
         _color[3] = Color.blue;
         _color[4] = Color.red;
         FireLine = VectorLine.SetLine(Color.white,_points);
         FireLine.smoothColor = true;
         FireLine.SetColors(_color);
         VectorManager.ObjectSetup(FirePoint,FireLine,Visibility.Always, Brightness.None);
     }
     float direct = Mathf.Acos (targetPos.x);
     direct = direct/Mathf.PI * 180;
     if (targetPos.y < 0)
         direct = 360-direct;
     FirePoint.transform.localPosition = new Vector3 (0, 0, 0);
     FirePoint.transform.rotation = Quaternion.Euler(new Vector3(0,0,direct));
 }
开发者ID:windyjl,项目名称:SDC_24,代码行数:32,代码来源:Ship.cs

示例2: OnChangeDirection

 public void OnChangeDirection()
 {
     if (ShipType == eShipType.Enemy)//以下代码给PlayerShip使用
         return;
     if (!FirePoint.activeInHierarchy)
         return;
     if (ShotDirX.text == "" || ShotDirY.text == "")
         return;
     Vector3 targetPos = new Vector3 (int.Parse(ShotDirX.text),int.Parse(ShotDirY.text),0);
     //如果是相对瞄准,不进行这步
     if (WeaponSystem.getInstance().bAimType_Abs)
     {
         targetPos -= transform.position;
     }
     targetPos.Normalize ();
     if (FireLine == null) {
         Vector3 [] _points = new Vector3[6];
         for(int i=0;i<6;++i)
         {
             _points[i]=new Vector3(pMain.AimLineScale*0.1f*i,0,0);
         }
         Color []  _color = new Color[5];
         _color[0] = Color.red;
         _color[1] = Color.yellow;
         _color[2] = Color.green;
         _color[3] = Color.blue;
         _color[4] = Color.red;
         FireLine = VectorLine.SetLine(Color.white,_points);
         FireLine.smoothColor = true;
         FireLine.SetColors(_color);
         VectorManager.ObjectSetup(FirePoint,FireLine,Visibility.Always, Brightness.None);
     }
     float direct = Mathf.Acos (targetPos.x);
     direct = direct/Mathf.PI * 180;
     if (targetPos.y < 0)
         direct = 360-direct;
     FirePoint.transform.rotation = Quaternion.Euler(new Vector3(0,0,direct));
     //FirePoint.transform.rotation = Quaternion.Euler (0,0,90);
 }
开发者ID:windyjl,项目名称:SDC_24,代码行数:39,代码来源:Ship.cs

示例3: OnEnemyRespawn

 public void OnEnemyRespawn()
 {
     Vector3 targetPos = new Vector3(Speed.x, Speed.y, 0);
     //targetPos -= transform.position;
     targetPos.Normalize();
     if (FireLine == null)
     {
         Vector3[] _points = new Vector3[6];
         for (int i = 0; i < 6; ++i)
         {
             _points[i] = new Vector3(pMain.AimLineScale * 0.1f * i, 0, 0);
         }
         Color[] _color = new Color[5];
         _color[0] = Color.red;
         _color[1] = Color.yellow;
         _color[2] = Color.green;
         _color[3] = Color.blue;
         _color[4] = Color.red;
         FireLine = VectorLine.SetLine(Color.white, _points);
         FireLine.smoothColor = true;
         FireLine.SetColors(_color);
         VectorManager.ObjectSetup(FirePoint, FireLine, Visibility.Always, Brightness.None);
     }
     float direct = Mathf.Acos(targetPos.x);
     direct = direct / Mathf.PI * 180;
     if (targetPos.y < 0)
         direct = 360 - direct;
     FirePoint.transform.rotation = Quaternion.Euler(new Vector3(0, 0, direct));
     //FirePoint.transform.rotation = Quaternion.Euler (0,0,90);
 }
开发者ID:windyjl,项目名称:SDC_24,代码行数:30,代码来源:Ship.cs


注:本文中的VectorLine.SetColors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。