// Start is called before the first frame update // We're not doing anything special at Start // So we can comment this out // void Start() // { // doInitialization(); // } // When you implement an abstract method, you must declare it as an _override_ public override bool DoControl(MystControl control) { if (control == controls[currentIndex]) { currentIndex++; if (currentIndex == controls.Length) { isComplete = true; DoComplete(); } return(showProgress); } else { if (resetOnMistake) { currentIndex = 0; ResetControls(); } return(false); } }
public override bool DoControl(MystControl control) { // This is the easier-to-read version for beginners // if (control.gameObject == confirmationButton || !requireConfirmation) // { // isCorrect = true; // } else { // isCorrect = false; // } // this is the slick version isCorrect = control.gameObject == confirmationButton || !requireConfirmation; if (isCorrect) { for (int i = 0; i < controls.Length; i++) { MystControl_Tumbler c = controls[i] as MystControl_Tumbler; isCorrect &= (c.currentState == combination[i]); } } if (isCorrect) { DoComplete(); } return(isCorrect); }
public override bool DoControl(MystControl control) { return(true); }
// Start is called before the first frame update // We're not doing anything special at Start // So we can comment this out // void Start() // { // doInitialization(); // } public override bool DoControl(MystControl control) { isToggled = !isToggled; DoComplete(); return(isToggled); }
// Mark any methods you will want to override with _abstract_ public abstract bool DoControl(MystControl control);