// Use this for initialization void Start() { m_velocityVector = new Vector3(-1, 0, 0); m_right = false; m_transform = this.transform; m_textureChange = GetComponent <TextureChange>(); timeAcum = 0; m_soundCollision = GetComponent <AudioSource>(); }
// Use this for initialization void Start() { m_velocityVector = new Vector3(-1,0,0); m_right = false; m_transform = this.transform; m_textureChange = GetComponent<TextureChange>(); timeAcum = 0; m_soundCollision = GetComponent<AudioSource>(); }
public LineDefLiftType(Trigger trigger, Repeatable repeatable, int wait, Speed speed, TextureChange textureChange, Model model, MonsterActivate monsterActivate, LiftTarget target) : base(Category.Lift) { this.trigger = trigger; this.repeatable = repeatable; this.speed = speed; this.textureChange = textureChange; this.model = model; this.monsterActivate = monsterActivate; this.target = target; }
public LineDefFloorType(Trigger trigger, Repeatable repeatable, Direction direction, Speed speed, TextureChange textureChange, Model model, MonsterActivate monsterActivate, Crush crush, FloorTarget target) : base(Category.Floor) { this.trigger = trigger; this.repeatable = repeatable; this.direction = direction; this.speed = speed; this.textureChange = textureChange; this.model = model; this.monsterActivate = monsterActivate; this.crush = crush; this.target = target; }
public void SetPlayerTexture(string path, string texType, GearInfoType infoType, bool useFull) { TextureChange texChange = new TextureChange("albedo", path); GearInfo newInfo; if (infoType == GearInfoType.Board) { newInfo = new BoardGearInfo("MP Temp " + texType.ToString(), texType, true, new TextureChange[] { texChange }, new string[0]); } else { newInfo = new CharacterGearInfo("MP Temp " + texType.ToString(), texType, true, new TextureChange[] { texChange }, new string[0]); } characterCustomizer.EquipGear(newInfo); }
public void SetPlayerTexture(string path, MPTextureType texType, bool useFull) { TextureChange texChange = new TextureChange("albedo", path); GearInfo newInfo; if ((byte)texType >= (byte)MPTextureType.Deck) { newInfo = new BoardGearInfo("MP Temp " + texType.ToString(), GetGearTypeFromTextureType(texType, useFull), true, new TextureChange[] { texChange }, new string[0]); } else { newInfo = new CharacterGearInfo("MP Temp " + texType.ToString(), GetGearTypeFromTextureType(texType, useFull), true, new TextureChange[] { texChange }, new string[0]); } characterCustomizer.EquipGear(newInfo); }
private void instantiatePlayer() { Vector3 posInstantiatePlayer = m_camera.ScreenToWorldPoint(new Vector3(Screen.width * 0.5f, Screen.height * 0.5f, 0)); m_player = Instantiate(m_playerPrefab); m_player.transform.position = new Vector3(posInstantiatePlayer.x, posInstantiatePlayer.y, 0); PendulumMovement pendulum = m_player.GetComponent <PendulumMovement>(); pendulum.GameManager = this; pendulum.m_velocityMagnitude = playerInitialVelocity; float posChangeTextureLeft = m_camera.ScreenToWorldPoint(new Vector3(Screen.width * (changeTexture + borderSize + separationBorder), 0, 0)).x; float posChangeTextureRight = m_camera.ScreenToWorldPoint(new Vector3(Screen.width * (1 - (changeTexture + borderSize + separationBorder)), 0, 0)).x; TextureChange texture = m_player.GetComponent <TextureChange>(); texture.xLeft = posChangeTextureLeft; texture.xRight = posChangeTextureRight; }
public override void LoadNestedItems(object[] objectsToLoad = null) { var gearToLoad = (GearInfo[])objectsToLoad; if (gearToLoad == null) { return; } if (LastLoaded != null && LastLoaded == gearToLoad) { return; } LastLoaded = gearToLoad; NestedItems.Clear(); CustomFolderInfo modIoFolder = null; foreach (var gear in gearToLoad) { GearInfo newGear = null; TextureChange textureChange = null; if (gear is GearInfoSingleMaterial singleMaterialGear) { textureChange = singleMaterialGear?.textureChanges?.FirstOrDefault(); newGear = singleMaterialGear; } else if (gear is CharacterBodyInfo characterBodyInfo) { var materialChange = characterBodyInfo.materialChanges.FirstOrDefault(); textureChange = materialChange?.textureChanges?.FirstOrDefault(); newGear = characterBodyInfo; } if (textureChange == null || string.IsNullOrEmpty(textureChange.texturePath)) { continue; } var isGearFolder = textureChange.texturePath.IsSubPathOf(SaveManager.Instance.CustomGearDir); var isModIo = textureChange.texturePath.IsSubPathOf(PluginSettings.INSTALLATION_DIRECTORY); CustomFolderInfo parent = null; if (isModIo) { AddFolder <CustomGearFolderInfo>("mod.io", null, NestedItems, ref parent); modIoFolder = NestedItems.FirstOrDefault(x => x.GetName() == "\\mod.io" && x.GetPath() == null) as CustomFolderInfo; var mod = InstalledGearMods.FirstOrDefault(x => textureChange.texturePath.IsSubPathOf(x.Key)); AddFolder <CustomGearFolderInfo>(mod.Value, null, modIoFolder.Children, ref parent); AddItem(newGear, parent.Children, ref modIoFolder); continue; } if (!isGearFolder && !isModIo) { continue; } string textureSubPath = string.Empty; string folderPath = string.Empty; if (isGearFolder) { textureSubPath = textureChange.texturePath.Replace(SaveManager.Instance.CustomGearDir + '\\', string.Empty); folderPath = SaveManager.Instance.CustomGearDir; } else if (isModIo) { textureSubPath = textureChange.texturePath.Replace(PluginSettings.INSTALLATION_DIRECTORY + '\\', string.Empty); folderPath = PluginSettings.INSTALLATION_DIRECTORY; } if (string.IsNullOrEmpty(textureSubPath) || string.IsNullOrEmpty(folderPath)) { continue; } var folders = textureSubPath.Split('\\').ToList(); if (!folders.Any()) { continue; } parent = null; if (folders.Count == 1 || IsImage(folders.First())) { // This gear item is at the root. AddItem(newGear, NestedItems, ref parent); continue; } parent = null; foreach (var folder in folders) { if (IsImage(folder)) { AddItem(newGear, parent == null ? NestedItems : parent.Children, ref parent); } else { folderPath = Path.Combine(folderPath, folder); AddFolder <CustomGearFolderInfo>(folder, folderPath, parent == null ? NestedItems : parent.Children, ref parent); } } } NestedItems = SortList(NestedItems); }