public void SpawnChairTest() { BaseEntity entity = GameManager.server.CreateEntity(this.chairRef.resourcePath, ((Component)this.chairAnchorTest).get_transform().get_localPosition(), (Quaternion)null, true); entity.Spawn(); DestroyOnGroundMissing component1 = (DestroyOnGroundMissing)((Component)entity).GetComponent <DestroyOnGroundMissing>(); if (Object.op_Inequality((Object)component1, (Object)null)) { ((Behaviour)component1).set_enabled(false); } MeshCollider component2 = (MeshCollider)((Component)entity).GetComponent <MeshCollider>(); if (Object.op_Implicit((Object)component2)) { component2.set_convex(true); } entity.SetParent((BaseEntity)this, false, false); }
private static int set_convex(IntPtr L) { object obj = null; int result; try { obj = ToLua.ToObject(L, 1); MeshCollider meshCollider = (MeshCollider)obj; bool convex = LuaDLL.luaL_checkboolean(L, 2); meshCollider.set_convex(convex); result = 0; } catch (Exception ex) { result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.get_Message() : "attempt to index convex on a nil value"); } return(result); }
private void Update() { VolumetricLightBeam component = (VolumetricLightBeam)((Component)this).GetComponent <VolumetricLightBeam>(); if (!Object.op_Implicit((Object)component)) { return; } MeshCollider orAddComponent = ((Component)this).get_gameObject().GetOrAddComponent <MeshCollider>(); Debug.Assert(Object.op_Implicit((Object)orAddComponent)); float lengthZ = component.fadeEnd * this.rangeMultiplier; float radiusEnd = Mathf.LerpUnclamped(component.coneRadiusStart, component.coneRadiusEnd, this.rangeMultiplier); this.m_Mesh = MeshGenerator.GenerateConeZ_Radius(lengthZ, component.coneRadiusStart, radiusEnd, 8, 0, false); ((Object)this.m_Mesh).set_hideFlags(Consts.ProceduralObjectsHideFlags); orAddComponent.set_sharedMesh(this.m_Mesh); if (this.setIsTrigger) { orAddComponent.set_convex(true); ((Collider)orAddComponent).set_isTrigger(true); } Object.Destroy((Object)this); }