// Use this for initialization void Start() { GUIController.Instance.HideText(); anim = GetComponent <Animator>(); anim.SetBool(isWalkingHash, true); EventManager.Instance.OnEventChange += HandleOnEventChange; EventManager.Instance.SetEventState(StoryEvents.movingBetween); currentState = PoliticianState.walking; moveTarget = (Vector2)Route[routeIndex].transform.position; }
IEnumerator StartRunningWithCandy() { currentState = PoliticianState.holdingCandy; yield return(new WaitForSeconds(1)); anim.SetTrigger(stepCandyHash); yield return(new WaitForSeconds(1)); anim.SetTrigger(stepCandyHash); }
IEnumerator RunHotDogEvent() { //wait for it to end yield return(new WaitForSeconds(2.0f)); currentState = PoliticianState.walking; anim.SetBool(roughUpHash, false); //Debug.Log ("event Over"); EventManager.Instance.SetEventState(StoryEvents.HotDogOver); EventEnds(); }
IEnumerator StealCandyEvent() { yield return(new WaitForSeconds(.50f)); currentState = PoliticianState.givingCandy; anim.SetTrigger(stepCandyHash); EventManager.Instance.SetEventState(StoryEvents.movingBetween); yield return(new WaitForSeconds(2.0f)); anim.SetTrigger(stepCandyHash); yield return(new WaitForSeconds(2.05f)); EventEnds(); StartCoroutine(Magic()); }
IEnumerator RunRibbonEvent() { //Run animations //withdraw_scissors anim.SetTrigger(stepRibbonHash); yield return(new WaitForSeconds(1.0f)); //maniac_laughter will start automatically currentState = PoliticianState.laughing; yield return(new WaitForSeconds(2.0f)); currentState = PoliticianState.walking; //triggerwalking towards ribbon anim.SetTrigger(stepRibbonHash); moveTarget = moveTarget + new Vector3(0, 1.5f, 0); while ((Vector2)transform.position != (Vector2)moveTarget) { yield return(null); } //trigger cut anim.SetTrigger(stepRibbonHash); yield return(new WaitForSeconds(0.5f)); //ribbonController; ribbonController.CutTheRibbon(); //wait for it to end yield return(new WaitForSeconds(1f)); //walk away anim.SetTrigger(stepRibbonHash); EventEnds(); }
public static bool EvaluatePhoto(PlayerVirtualCamera virtualCam, EventWayPoint currentEvent, PoliticianState state) { if (!virtualCam.ContainsAll(currentEvent.RequiredItems)) { return(false); } if (virtualCam.ContainsAny(currentEvent.RestrictedItems)) { return(false); } if (state == currentEvent.RequiredState) { return(true); } return(false); }