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 UpdateWhenColoring() { if (timer.IsNoTimeLeft) { SetStateAfterColoring(); currentState = GameState.TimeIsUp; } if (colorWheel.IsFinishedSelecting) { SetStateAfterColoring(); if (currentlySelectedColor != null) { currentColorableInstance.SetColor(currentlySelectedSection.index, currentlySelectedColor.ColorValue); currentColorableInstance.TurnOnLayer(ColorableInstance.LAYER_TYPE.COLORS, currentlySelectedSection.index); } ++coloredSections; Debug.Log(currentColorableInstance.SectionHolders.Length); if (coloredSections == currentColorableInstance.SectionHolders.Length) { SetStateAfterFinishedMonster(); currentState = GameState.PickingMonster; return; } alreadySetupBeforePicking = false; currentState = GameState.PickingSection; return; } if (currentlySelectedColor != null) { currentlySelectedSection.GetComponentInParent <ColorableInstance>(); currentColorableInstance.SetColor(currentlySelectedSection.index, currentlySelectedColor.ColorValue); currentColorableInstance.TurnOnLayer(ColorableInstance.LAYER_TYPE.COLORS, currentlySelectedSection.index); } }