public virtual void Confirm(OptButton tbn = null) { if (featuresSelected == null) { return; } // Debug.Log("Okay now " + this.GetType().ToString()); // Debug.Log("-> " + this.destination.GetType().ToString()); //check features for feature pointers. wire them into to be the next state, with the last customization state //pointing to this destination... List <CharacterCustomizationStep> steps = new List <CharacterCustomizationStep>(); foreach (GenericFeature f in featuresSelected) { if (f is FeaturePointer) { FeaturePointer pointer = (FeaturePointer)f; steps.Add(pointer.GetCustomizationStep(characterCustomization)); } } if (steps.Count > 0) { CharacterCustomizationStep nextStep = steps [0]; CharacterCustomizationStep nextPrevious = this; for (int i = 1; i < steps.Count; i++) { nextStep.destination = steps [i]; nextStep.previous = nextPrevious; nextPrevious = nextStep; nextStep = steps [i]; } nextStep.destination = destination; nextStep.previous = nextPrevious; characterCustomization.SwitchState(steps [0]); } else { characterCustomization.SwitchState(destination); } }
public ChooseFromPoolOfFeatures(FeaturePointer ptr, CharacterCustomizationController controller) : base(controller) { this.featurePointer = ptr; buttonsToFeatureOpts = new Dictionary <OptButton, GenericFeature> (); }