public override void Configure() { base.Setup(new CharacterMovementController(this), new PlayerInput(this), new PlayerChillBehaviourTree(new IdleState(this), this)); hp = 0; //Particular of the player inventory = new InventoryController(this); stressController = GetComponent <StressController>();//new StressController(this, stressThreshold); }
// Use this for initialization void Start() { currentScenario = 0; lastScenario = 0; DelayScenario = GameOverScenario - 1; this.gameObject.GetComponent <SpriteRenderer>().sprite = face_neutral; dragon = GameObject.Find("Dragon").GetComponent <DragonController>(); stressButton = GameObject.Find("Stress Button").GetComponent <StressController>(); timer = maxResponseTime; InitScript(); LoadScenario(currentScenario); }
public TelephoneCentral(GameController gameController, Board board, StressController stressController, PhoneUsers phoneUsers, SFXController sfxController) { Instance = this; this.board = board; this.stressController = stressController; this.gameController = gameController; this.phoneUsers = phoneUsers; this.sfxController = sfxController; board.OnTalkingFinished += FinishCall; board.SubscribeToJabEvent(ConnectCall); stressController.OnStressPeak += EndCalls; LoadCallGroups(); }
private void OnTriggerExit2D(Collider2D collision) { StressController stressController = collision.GetComponent <StressController>(); if (stressController != null) { try { stressing.Remove(stressController); } catch (System.NullReferenceException) { } if (coroutineHolder != null && stressing.Count <= 0) { StopCoroutine(coroutineHolder); coroutineHolder = null; } } }
private void OnTriggerEnter2D(Collider2D collision) { StressController stressController = collision.GetComponent <StressController>(); if (collision.isTrigger) { return; } if (stressController != null && emitStress) { if (!stressing.Contains(stressController)) { stressing.Add(stressController); if (coroutineHolder == null) { coroutineHolder = AddStressOverTime(timeBetweenEmisions, stressAmountPerSecond); StartCoroutine(coroutineHolder); } } } }
protected override IEnumerator StartState() { character.rb2d.AddForce(hitDirection * hitStrength, ForceMode2D.Impulse); character.visualsAnimator.SetTrigger("Dead"); character.audioController.PlaySound(character.deadSound, false, false); PlayerManager pm = null; try { pm = (PlayerManager)character; } catch (System.InvalidCastException) { pm = null; } if (pm != null) { GUIManager.Instance.DeathScreenPanel.SetObjectActive(true); yield return(new WaitForSeconds(GUIManager.Instance.DeathScreenPanel.fadeTimeDuration)); GameManager.Instance.RevivePlayer(); } StressController sc = character.GetComponent <StressController>(); if (sc != null) { sc.audioPlayingWhileBeingChased.Stop(); sc.audioPlayingWhileStressing.Stop(); } yield return("success"); }
private void Awake() { instance = this; }