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


C# Vector2.ToVector3方法代码示例

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


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

示例1: InitPositioning

 private void InitPositioning(Vector2 position, bool flyUp)
 {
     this.transform.position = position.ToVector3(this.transform.position.z);
     initialPosition = this.transform.position;
     if (flyUp)
     {
         RectTransform bubbleTransform = GetComponent<RectTransform>();
         Rect canvasRect = canvas.GetComponent<RectTransform>().rect;
         this.targetPosition = canvas.transform.TransformPoint(new Vector3(Random.Range(-180, 180), canvasRect.height / 2 - 140, bubbleTransform.localPosition.z));
     }
     else
     {
         this.targetPosition = position.ToVector3(transform.position.z);
     }
 }
开发者ID:maximecharron,项目名称:GLO-3002-Frima,代码行数:15,代码来源:BubbleController.cs

示例2: Translate

 public static void Translate(this Rigidbody2D rigidbody, Vector2 translation, Axes axes = Axes.XY)
 {
     rigidbody.SetPosition(rigidbody.transform.position + translation.ToVector3(), axes);
 }
开发者ID:Magicolo,项目名称:No-Love-No-Gain,代码行数:4,代码来源:Rigidbody2DExtension.cs

示例3: AddPoint

		public int AddPoint(Vector2 point, int insertPoint)
		{
			if(insertPoint < 0 || insertPoint > points.Count-1)
				points.Add(new PolydrawPoint2(transform.InverseTransformPoint(point.ToVector3(drawSettings.axis, drawSettings.zPosition)).ToVector2(drawSettings.axis)));
			else
				points.Insert(insertPoint, new PolydrawPoint2(transform.InverseTransformPoint(point.ToVector3(drawSettings.axis, drawSettings.zPosition)).ToVector2(drawSettings.axis)));

			#if UNITY_EDITOR
				EditorUtility.SetDirty(this);
			#endif

			return (insertPoint < 0 || insertPoint > points.Count-1) ? points.Count-1 : insertPoint;
		}
开发者ID:wtrebella,项目名称:Grappler,代码行数:13,代码来源:PolydrawObject.cs

示例4: SetPoint

		public void SetPoint(int index, Vector2 point)
		{
			if(index > -1 && index < points.Count) {
				PolydrawPoint2 currentPoint = points[index];
				PolydrawPoint2 newPoint = new PolydrawPoint2(transform.InverseTransformPoint(point.ToVector3(drawSettings.axis, drawSettings.zPosition)).ToVector2(drawSettings.axis));
				newPoint.borderIgnored = currentPoint.borderIgnored;
				points[index] = newPoint;
			}

			#if UNITY_EDITOR
				EditorUtility.SetDirty(this);
			#endif
		}
开发者ID:wtrebella,项目名称:Grappler,代码行数:13,代码来源:PolydrawObject.cs

示例5: Show

        public void Show(Vector2 position, float zPosition)
        {

            this.transform.localPosition = position.ToVector3(zPosition);
            startTime = Time.time;
            SetAlpha(0);
            this.gameObject.SetActive(true);
        }
开发者ID:maximecharron,项目名称:GLO-3002-Frima,代码行数:8,代码来源:ComboHitZoneController.cs


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