public void RemoveSector(Sector s, PlaneType pt) { Debug.WriteLine("Removing from Sector " + s.Index.ToString() + ": " + pt.ToString()); if (sectorplanes.ContainsKey(s)) { if (sectors.Contains(s) && sectorplanes[s] == pt) { sectors.Remove(s); sectorplanes.Remove(s); } else { sectorplanes[s] &= ~pt; } } if ((pt & PlaneType.Floor) == PlaneType.Floor) { s.FloorSlope = new Vector3D(); s.FloorSlopeOffset = 0; s.Fields.Remove("user_floorplane_id"); } if ((pt & PlaneType.Ceiling) == PlaneType.Ceiling) { s.CeilSlope = new Vector3D(); s.CeilSlopeOffset = 0; s.Fields.Remove("user_ceilingplane_id"); } }
string GetPlanePrefabPath(PlaneType _type) { if (mapPlanePrefabPath.ContainsKey(_type) == false) { string name = "prefab/" + _type.ToString(); mapPlanePrefabPath.Add(_type, name); } return(mapPlanePrefabPath[_type]); }
public PlaneAttribute AddPlaneByModel(string model, PlaneType planeType = PlaneType.Enemy) { if (!ModelResMgr.Instance.ActivePlaneDict.ContainsKey(model)) { return(null); } GameObject PlaneObj = null; if (mInactivePlaneDict.ContainsKey(model)) { PlaneObj = mInactivePlaneDict[model][0]; mInactivePlaneDict[model].RemoveAt(0); if (mInactivePlaneDict[model].Count == 0 || mInactivePlaneDict[model] == null) { mInactivePlaneDict.Remove(model); } } else { PlaneObj = Instantiate(mResLoader.LoadSync <GameObject>(Planepre.BundleName, model)) as GameObject; } PlaneAttribute planeAttribute = PlaneObj.AddComponent <PlaneAttribute>(); planeAttribute.hpElement = PlaneObj.AddComponent <HPElement>(); planeAttribute.CtrlType = planeType; planeAttribute.Model = model; planeAttribute.gameObject.tag = planeType.ToString(); planeAttribute.transform.localPosition = new Vector3(-456.4f, 146.9f, 363.2f); switch (planeType) { case PlaneType.Player: PlaneObj.AddComponent <Player>(); break; case PlaneType.Friendly: PlaneObj.AddComponent <Friendly>(); break; case PlaneType.Enemy: PlaneObj.AddComponent <Enemy>(); break; default: break; } return(planeAttribute); }
public static void SaveEngineConfig() { String[] configuration = new String[20]; configuration[0] = BloomEnabled.ToString(); configuration[1] = SoundEnabled.ToString(); configuration[2] = SoundSystem.ToString(); configuration[3] = SoundVolume.ToString(); configuration[4] = MusicVolume.ToString(); configuration[5] = LowDetails.ToString(); configuration[6] = InverseKeys.ToString(); configuration[7] = UseAlternativeSpinControl.ToString();// Settings.Default.Language; configuration[8] = Difficulty.ToString(); configuration[9] = ShowIntro.ToString(); configuration[10] = DisplayMinimap.ToString(); configuration[11] = UseHydrax.ToString(); configuration[12] = ShadowsQuality.ToString(); configuration[13] = AudioStreaming.ToString(); configuration[14] = UseHardwareTexturePreloader.ToString(); configuration[15] = Gore.ToString(); configuration[16] = HardwareTexturePreloaderTextureLimit.ToString(); configuration[17] = UseAsyncModel.ToString(); configuration[18] = UpdateHydraxEveryFrame.ToString(); configuration[19] = CurrentPlayerPlaneType.ToString(); ExplosionLights = !LowDetails; BodiesStay = !LowDetails; //File.Create(C_ENGINE_CONFIG); File.WriteAllLines(C_ENGINE_CONFIG, configuration); // string materialDir = "../../media/materials/scripts/ParentScripts/"; if (ShadowsQuality > 0 /*&& UseHydrax*/) { // File.Copy(materialDir+"0NormalMappedSpecular.base", materialDir+"0NormalMappedSpecular.material",true ); } else { // File.Copy(materialDir+"0NormalMappedSpecularNoShadows.base", materialDir+"0NormalMappedSpecular.material",true ); } }
private void InstantiateMeshObject() { MeshObject = new GameObject(settings.TerrainManagerName + "-MeshPiece" + PlaneType.ToString()); AddMeshComponents(); }