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


C# World.GetComponent方法代码示例

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


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

示例1: RemoveZoneBlocks

	// Removes the zone with its blocks
	public void RemoveZoneBlocks(Vector3 HitPosition, World MyHitWorld) {
		//Debug.LogError ("Building Core being Removed");
		// get zone
		Zone MyZone = GetManager.GetZoneManager().GetZoneFromBlock(HitPosition);
		Vector3 ZoneSize = MyZone.Size;
		for (float i = -Mathf.FloorToInt(ZoneSize.x); i <= Mathf.FloorToInt(ZoneSize.x); i++)
			for (float j = -Mathf.FloorToInt(ZoneSize.y)+1; j <= Mathf.FloorToInt(ZoneSize.y); j++)
			for (float k = -Mathf.FloorToInt(ZoneSize.z); k <= Mathf.FloorToInt(ZoneSize.z); k++) {
				if (GetManager.GetNetworkManager().IsConnected()) {
					MyHitWorld.GetComponent<NetworkView>().RPC ("SetBlockAir", 
					                                            RPCMode.All,
					                                            Mathf.FloorToInt(i+MyZone.InBlockPosition.x),
					                                            Mathf.FloorToInt(j+MyZone.InBlockPosition.y),
					                                            Mathf.FloorToInt(k+MyZone.InBlockPosition.z)
					                                            );
				}
			}
		GetManager.GetZoneManager().DestroyZone (MyZone);
	}
开发者ID:Deus0,项目名称:Zeltex,代码行数:20,代码来源:BaseCharacter.cs

示例2: RemoveBlock

	public void RemoveBlock(BlockData MyBlockData, Vector3 HitPosition, World MyHitWorld) {
		switch (MyBlockData.OnDestroyFunctionId)
		{
		case(1):	// for zone cores
			RemoveZoneBlocks (HitPosition, MyHitWorld);
			break;
		case(2):	// town hall end of game condition?
			GetManager.GetGameManager().EndGame();
			RemoveZoneBlocks (HitPosition, MyHitWorld);
			break;
		case(3):// TNT

			break;
		}
		if (MyBlockData.RemovedSoundEffect)
			SoundSource.PlayOneShot (MyBlockData.RemovedSoundEffect);
		if (GetManager.GetNetworkManager ().IsConnected ())
			MyHitWorld.GetComponent<NetworkView> ().RPC ("SetBlockAir", 
			                                            RPCMode.All,
			                                            Mathf.RoundToInt (HitPosition.x),
			                                            Mathf.RoundToInt (HitPosition.y),
			                                            Mathf.RoundToInt (HitPosition.z)
			);
		else
			MyHitWorld.SetBlockAir (Mathf.RoundToInt (HitPosition.x),
			                       Mathf.RoundToInt (HitPosition.y),
			                       Mathf.RoundToInt (HitPosition.z));
	}
开发者ID:Deus0,项目名称:Zeltex,代码行数:28,代码来源:BaseCharacter.cs

示例3: Initialized

 public override void Initialized(World world)
 {
     world.GetComponent<LimitedWorld>().Adjust();
 }
开发者ID:shinobushiva,项目名称:Arisco-Core,代码行数:4,代码来源:LimitedWorld.cs


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