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


C# AstarSerializer.GetUnityReferenceValue方法代码示例

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


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

示例1: DeSerializeSettings

            public void DeSerializeSettings(AstarSerializer serializer)
            {
                enabled = (bool)serializer.GetValue ("enabled",typeof(bool));
                source = (Texture2D)serializer.GetUnityReferenceValue ("source",typeof(Texture2D));
                factors = new float[3];
                for (int i=0;i<factors.Length;i++) {
                    factors[i] = (float)serializer.GetValue ("factor"+i,typeof(float),1F);
                }

                channels = new ChannelUse[3];
                for (int i=0;i<channels.Length;i++) {
                    channels[i] = (ChannelUse)serializer.GetValue ("channel"+i,typeof(int));
                }
            }
开发者ID:sonygod,项目名称:ESPUnity,代码行数:14,代码来源:GridGenerator.cs

示例2: DeSerializeSettings

		public void DeSerializeSettings (AstarSerializer serializer) {
			
			root = (Transform)serializer.GetUnityReferenceValue ("root",typeof(Transform));
			
			maxDistance = (float)serializer.GetValue ("maxDistance",typeof(float));
			limits = (Vector3)serializer.GetValue ("limits",typeof(Vector3));
			mask.value = (int)serializer.GetValue ("mask",typeof(int));
			thickRaycast = (bool)serializer.GetValue ("thickRaycast",typeof(bool));
			thickRaycastRadius = (float)serializer.GetValue ("thickRaycastRadius",typeof(float));
			searchTag = (string)serializer.GetValue ("searchTag",typeof(string));
			recursive = (bool)serializer.GetValue ("recursive",typeof(bool));
			raycast	  = (bool)serializer.GetValue ("raycast",typeof(bool),true);
		}
开发者ID:JustSAT,项目名称:Tower-Defence,代码行数:13,代码来源:PointGenerator.cs

示例3: DeSerializeSettings

		public void DeSerializeSettings (AstarSerializer serializer) {
			
			System.IO.BinaryReader stream = serializer.readerStream;
			
			offset = (Vector3)serializer.GetValue ("offset",typeof(Vector3));
			rotation = (Vector3)serializer.GetValue ("rotation",typeof(Vector3));
			scale = (float)serializer.GetValue ("scale",typeof(float));
			
			GenerateMatrix ();
			
			Vector3[] verts = new Vector3[stream.ReadInt32 ()];
			int[] tris = new int[stream.ReadInt32 ()];
			
			for (int i=0;i<verts.Length;i++) {
				verts[i] = new Vector3(stream.ReadSingle (),stream.ReadSingle (),stream.ReadSingle ());
			}
				
			for (int i=0;i<tris.Length;i++) {
				tris[i] = stream.ReadInt32 ();
			}
			
			sourceMesh = serializer.GetUnityReferenceValue ("sourceMesh",typeof(Mesh)) as Mesh;
			
			if (Application.isPlaying) {
				sourceMesh = new Mesh ();
				sourceMesh.name = "NavGraph Mesh";
				sourceMesh.vertices = verts;
				sourceMesh.triangles = tris;
			}
		}
开发者ID:pravusjif,项目名称:PravusUnityTests,代码行数:30,代码来源:NavMeshGenerator.cs


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