public BEPUphysics.ISpaceObject CreateCollision(JMapObjectData block) { BEPUphysics.ISpaceObject collision = null; if (block.colliderTypes == 0) { BEPUphysics.EntityStateManagement.MotionState ms = new BEPUphysics.EntityStateManagement.MotionState(); ms.Position = new BEPUutilities.Vector3(block.mapPos.x, block.mapPos.y, block.mapPos.z); ms.Orientation = new BEPUutilities.Quaternion(block.mapRot.x, block.mapRot.y, block.mapRot.z, block.mapRot.w); collision = new Box(ms, block.mapScale.x, 1f, block.mapScale.y); } else { var vertices = new BEPUutilities.Vector3[block.meshColliderVertices.Length]; int[] indices = new int[block.meshColliderIndices.Length]; for (int i = 0; i < vertices.Length; ++i) { vertices[i] = new BEPUutilities.Vector3(block.meshColliderVertices[i].x, block.meshColliderVertices[i].y, block.meshColliderVertices[i].z); } for (int i = 0; i < indices.Length; ++i) { indices[i] = block.meshColliderIndices[i]; } var Position = new BEPUutilities.Vector3(block.mapPos.x, block.mapPos.y, block.mapPos.z); var Orientation = new BEPUutilities.Quaternion(block.mapRot.x, block.mapRot.y, block.mapRot.z, block.mapRot.w); var staticMesh = new BEPUphysics.BroadPhaseEntries.StaticMesh(vertices, indices, new BEPUutilities.AffineTransform(new BEPUutilities.Vector3(0.1f, 0.1f, 0.1f), Orientation, Position)); //staticMesh.Sidedness = BEPUutilities.TriangleSidedness.DoubleSided; collision = staticMesh; } space.Add(collision); return(collision); }
public void InitFrom(JMapObjectData mapData) { mapObjectId = (ushort)mapData.uID; mHealth = mapData.objectHP; Set(mapData); //LogHelper.LogInfo($"create propHealth {NetworkId}, {mapObjectId}"); }
public void InitFrom(JMapObjectData mapData) { mapObjectId = (ushort)mapData.uID; mOnOff = false; this.mapData = mapData; Set(mapData); //LogHelper.LogInfo($"create Button {NetworkId}, {mapObjectId}"); }
public void Set(JMapObjectData mapData) { this.mapData = mapData; mapObjectId = mapData.uID; hp = (ushort)mapData.jCastleData[0].castleHP; hp_max = (ushort)mapData.jCastleData[0].castleHP; Team = (byte)mapData.jCastleData[0].castleTeam; }
public static void AddSpawnPosition(List <JSpawnData> spawn, JMapObjectData mapObjectData) { if ((mapObjectData.mapTypes & (1 << (int)MapPropertyType.Spawn)) != 0) { mapObjectData.jSpawnData[0].mapPos = mapObjectData.mapPos; mapObjectData.jSpawnData[0].mapPos.y = mapObjectData.mapPos.y + 1f; spawn.Add(mapObjectData.jSpawnData[0]); } }
public virtual void Set(JMapObjectData mapData) { //Scale = mapData.mapScale; Scale.x = 2f; Scale.y = 2f; widthHalf = 1f; heightHalf = 1f; SetLocation(mapData.mapPos); }
public override void Set(JMapObjectData mapData) { base.Set(mapData); this.mapData = mapData; mapObjectId = mapData.uID; ResetCoolTime(mapData.jAutoItemData[0].openStartTime); #if UNITY_EDITOR || DEBUG Log.Information($"create TreasureBox {NetworkId}"); #endif }
public void Set(JMapObjectData mapData) { Init(); if (mapData.jMapSwitchData.Length > 0) { if (mapData.jMapSwitchData[0].coolTime > 0) { DefaultPlayTime = mapData.jMapSwitchData[0].coolTime; } } }
public void Set(JMapObjectData mapData) { LogHelper.LogInfo($"train set networkId:{GetNetworkId()}, worldId:{WorldId}, mapUid:{mapData.uID}"); mapObjectId = mapData.uID; this.mapData = mapData; SetLocation(mapData.jMapMovePathData[0].moveStartPos); speed = mapData.jMapMovePathData[0].moveSpeed; mVelocity = mapData.jMapMovePathData[0].moveEndPos - mapData.jMapMovePathData[0].moveStartPos; mVelocity.Normalize(); mVelocity = mVelocity * speed; // todo : 테스트용 //IsStarted = true; //IsRun = true; //mCreateTime = Timing.sInstance.GetFrameStartTime(); }
public virtual void Set(JMapObjectData mapData) { mapObjectId = mapData.uID; this.mapData = mapData; mCreateTime = mapData.jAutoBombData[0].createTime + Timing.sInstance.GetFrameStartTime(); }
public void Set(JMapObjectData mapData) { Init(); }