public void InsertMonsters(MonsterHolder holder) { GameObject monster = holder.MonsterModel; GameObject outline = holder.MonsterOutlined; // Enemy OUTLINE ColorableInstance colorableInstance = outline.GetComponent <ColorableInstance>(); colorableInstance.MakeColoredModel(); outline.SetActive(true); outline.transform.parent = OutlinedModelSlot.transform; outline.transform.localPosition = new Vector3(0, 0, outline.transform.localPosition.z); outline.transform.localScale = colorableInstance.Colorable.ModelScale; // ENEMY ColoredModel colorableInstance = monster.GetComponent <ColorableInstance>(); colorableInstance.MakeModel(); monster.SetActive(true); monster.transform.parent = ModelSlot.transform; monster.transform.localPosition = new Vector3(0, 0, monster.transform.localPosition.z); monster.transform.localScale = colorableInstance.Colorable.ModelScale; if (EnemiesAssignedToScene == false) { SetBlackBackgroundToEnvironmentEnemies(); } SetBlackBackgroundToEnvironmentEnemies(holder); }
public MonsterHolder NextMonster() { MonsterHolder monster = monsters[nextMonsterIndex]; nextMonsterIndex++; return(monster); }
private void PickMonster() { if (!currentDungeon.IsAvailable()) { if (CurrentDungeonIndex == MaxLevels) { // The player has won currentState = GameState.Won; return; } currentState = GameState.Generating; timer.Reset(); colorWheel.Deactivate(); LabelCreator.Instance.CreateLabelEvent("Next wave!", 3f, new Color(1, 0, 0, 1)); return; } currentMonsterHolder = currentDungeon.NextMonster(); currentColorableInstance = currentMonsterHolder.MonsterOutlined.GetComponent <ColorableInstance>(); coloredSections = 0; currentState = GameState.CreatingScene; }
/// <summary> /// /// </summary> /// <param name="monsterHolder"></param> public void UpdateMonsters([NotNull] MonsterHolder monsterHolder) { Assert.ArgumentNotNull(monsterHolder, "monsterHolder"); if (_monstersWidget.ViewModelUid == monsterHolder.Uid) { _monstersWidget.UpdateModel(monsterHolder.Characters); } }
private void SetBlackBackgroundToEnvironmentEnemies(MonsterHolder holder) { ColorableInstance colorableInstance = holder.SceneMonster.GetComponent <ColorableInstance>(); int _size = colorableInstance.Colorable.Sections.Length; for (int j = 0; j < _size; j++) { colorableInstance.SetColor(j, new Color(0, 0, 0, 0.4f)); colorableInstance.TurnOnLayer(ColorableInstance.LAYER_TYPE.COLORS, j); } }
private void GenerateMonsters() { int enemies = dungeonConstants.NumberOfMonsters; MonsterGenerator monsterGenerator = new MonsterGenerator(dungeonConstants); for (int i = 0; i < enemies; i++) { MonsterHolder monsterHolder = monsterGenerator.CreateMonsters(); monsterHolder.Deactivate(); dungeon.AddMonster(monsterHolder); } }
public MonsterHolder CreateMonsters() { MonsterHolder monsterHolder = new MonsterHolder(); monsterHolder.Init(createNewMonster()); ColorableInstance monsterOutlinedColorable = monsterHolder.MonsterOutlined.GetComponent <ColorableInstance>(); ColorableInstance SceneMonsterColorable = monsterHolder.SceneMonster.GetComponent <ColorableInstance>(); monsterOutlinedColorable.Sibling = SceneMonsterColorable; SceneMonsterColorable.DisableColliders(); monsterHolder.MonsterModel.GetComponent <ColorableInstance>().DisableColliders(); return(monsterHolder); }
public void AddMonster(MonsterHolder monster) { monsters.Add(monster); }