IEnumerator GivenPotion(SellPotion potion) { potion.transform.parent = transform; myAnimator.SetTrigger("leave"); yield return(new WaitForSeconds(0.25f)); myAgent.destination = travelToPosition.position; yield return(new WaitForSeconds(1)); while (myAgent.remainingDistance > 0.5f) { yield return(null); } potion.gameObject.SetActive(false); myAgent.destination = standingPosition.position; yield return(new WaitForSeconds(1)); while (myAgent.remainingDistance > 0.25f) { yield return(null); } myAnimator.SetTrigger("place"); yield return(new WaitForSeconds(0.5f)); RespawnManager respawner = FindObjectOfType <RespawnManager> (); foreach (GameObject rewardPrefab in potion.lootToReturn) { GameObject spawned = (GameObject)Instantiate(rewardPrefab, travelToPosition.position + Vector3.up, Quaternion.identity); respawner.Respawn(spawned); } Destroy(potion.gameObject); }
private void Awake() { if (instance == null) { instance = this; } }
void Awake() { if (gc == null) { gc = this; } else { // if this one's a duplicate, destroy Destroy(this.gameObject); return; } DontDestroyOnLoad(this); titleText = editorTitleText; dialogueUI = GetComponentInChildren <DialogueUI>(); signUI = GetComponentInChildren <SignUI>(); pc = GetComponentInChildren <PlayerController>(); rm = GetComponent <RespawnManager>(); playerFollower = gc.GetComponentInChildren <PlayerFollower>(); save = gc.GetComponent <Save>(); blackoutUI = GetComponentInChildren <BlackFadeUI>(); pauseUI = gc.transform.Find("PixelCanvas").transform.Find("PauseUI").GetComponent <Animator>(); abilityUIAnimator = gc.transform.Find("PixelCanvas").transform.Find("AbilityGetUI").GetComponent <Animator>(); inventory = gc.GetComponentInChildren <InventoryController>(); parallaxOption = gc.GetComponentInChildren <ParallaxOption>(); }
public CharacterCampaignData(Client client, bool giveRespawnPenaltyAffliction = false) { Name = client.Name; InitProjSpecific(client); healthData = new XElement("health"); client.Character?.CharacterHealth?.Save(healthData); if (giveRespawnPenaltyAffliction) { var respawnPenaltyAffliction = RespawnManager.GetRespawnPenaltyAffliction(); healthData.Add(new XElement("Affliction", new XAttribute("identifier", respawnPenaltyAffliction.Identifier), new XAttribute("strength", respawnPenaltyAffliction.Strength.ToString("G", CultureInfo.InvariantCulture)))); } if (client.Character?.Inventory != null) { itemData = new XElement("inventory"); Character.SaveInventory(client.Character.Inventory, itemData); } OrderData = new XElement("orders"); if (client.Character != null) { CharacterInfo.SaveOrderData(client.Character.Info, OrderData); } }
// Start is called before the first frame update void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); scoreManager = gameControllerObject.GetComponent <ScoreManager>(); respawnManager = gameControllerObject.GetComponent <RespawnManager>(); }
void Awake() { if (gc == null) { gc = this; } else { // if this one's a duplicate, destroy Destroy(this.gameObject); return; } DontDestroyOnLoad(this); titleText = editorTitleText; dialogueUI = GetComponentInChildren <DialogueUI>(); signUI = GetComponentInChildren <SignUI>(); pc = GetComponentInChildren <PlayerController>(); rm = GetComponent <RespawnManager>(); playerFollower = gc.GetComponentInChildren <PlayerFollower>(); save = gc.GetComponent <SaveWrapper>().save; blackoutUI = GetComponentInChildren <BlackFadeUI>(); pauseUI = GetComponentInChildren <PauseUI>(); abilityUIAnimator = GameObject.Find("AbilityGetUI").GetComponent <Animator>(); inventory = gc.GetComponentInChildren <InventoryController>(); parallaxOption = gc.GetComponentInChildren <ParallaxOption>(); bossHealthUI = GameObject.Find("BossHealthUI").GetComponent <BarUI>(); bossHealthUI.gameObject.SetActive(false); playerMenu = GameObject.Find("PlayerMenu"); binarySaver = gc.GetComponent <BinarySaver>(); saveWrapper = gc.GetComponent <SaveWrapper>(); audioListener = gc.GetComponentInChildren <AudioListener>(); bossFightIntro = gc.GetComponentInChildren <BossFightIntro>(includeInactive: true); }
void Start() { cc = GetComponent <PlayerController2D>(); rb = GetComponent <Rigidbody2D>(); sr = GetComponent <SpriteRenderer>(); moveset = GetComponent <MoveSet>(); input = GetComponent <InputHandler>(); anim = GetComponent <Animator>(); health = GetComponent <Health>(); audioSource = GetComponent <AudioSource>(); ailmentHandler = GetComponent <AilmentHandler>(); knockbackListener = GetComponent <KnockbackListener>(); cameraFocusPointDefaultPosition = cameraFocusPoint.transform.position; playerOffset = transform.position; spellList = FindObjectOfType <SpellDatabase>(); fas = GetComponent <FighterAnimationScript>(); input.player = this; input.spellDatabase = spellList; fas.fighter = this; fas.cc = cc; fas.anim = anim; gm = FindObjectOfType <GameManager>(); rm = FindObjectOfType <RespawnManager>(); maxNumberOfJumps++; cc.m_maxJumps = maxNumberOfJumps; cc.m_doubleJumpEnabled = canDoubleJump; comboTimer = defaultComboTime; }
public static void Postfix(RespawnManager __instance, SpawnableTeamType teamToSpawn) { int counter = 0; foreach (Player Ply in Player.List) { if (Ply.Role.IsNotHuman(true)) { counter++; } } if (CreativeToolbox.ConfigRef.Config.EnableRandomChaosInsurgencyAnnouncementChance) { NewChance = CIAnnouncementChance.Next(0, 100); if (NewChance < CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementChance) { if (CreativeToolbox.ConfigRef.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency) { NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(CreativeToolboxEventHandler.FormatMessage(CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncement, counter), CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f, CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f); } } } else if (CreativeToolbox.ConfigRef.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency) { NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(CreativeToolboxEventHandler.FormatMessage(CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncement, counter), CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f, CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f); } }
// Use this for initialization void Start() { m_RespawnManager = GameObject.FindGameObjectWithTag("RespawnManager").GetComponent <RespawnManager> (); if (m_RespawnManager == null) { m_LobbySpawn = GameObject.FindGameObjectWithTag("RespawnManager").GetComponent <LobbySpawn> (); } }
void Start() { //transform.position = startCenter.transform.position; rigid = character.GetComponent <Rigidbody>(); anim = character.GetComponent <Animator>(); respawnManager = FindObjectOfType <RespawnManager>(); }
// Start is called before the first frame update void Start() { gamePlaying = false; gameIsOver = false; playAgainDisplay.text = ""; respawnManager = GetComponent <RespawnManager>(); StartCoroutine(CountdownToStart()); }
private void OnDisable() { if (!MainLevel.Instance) { return; } RespawnManager.Get().UnregisterRespawnPoint(this); }
/// <summary> /// This deserializses and loads the latest save making it possible to jump back to a previous spawnpoint or continue an already started game /// when pressing the load button. This needs testing /// </summary> public void LoadSave() { spawner = GameManager.managerWasa.RespawnManage; // current solution will be replaced when respawnsystem is rewamped to higher level in hierarchy RepawnInsans inst = SaveAndLoad.LoadGameData(); // create respawninstance that is used for loading the game spawner.RespwnNow(inst); // calls the respawn now function of the respawnmanager Resume(); // resumes game to where it was for a little while ago. }
private void Awake() { rigidbody2D = GetComponent <Rigidbody2D>(); gameObject = rigidbody2D.gameObject; GameObject gameControllerObject = GameObject.FindWithTag("GameController"); gameController = gameControllerObject.GetComponent <RespawnManager>(); }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { RespawnManager manager = GameObject.FindObjectOfType <RespawnManager>(); manager.SetPlayerPosition(other.transform); } }
private void Awake() { if (Singleton) { enabled = false; return; } Singleton = this; }
private void Start() { if (instance != null) { Debug.LogWarning("RespawnManager instance already set"); return; } instance = this; }
public virtual void Start() { rb2d = GetComponent <Rigidbody2D>(); health = GetComponent <Health>(); spellIndex = FindObjectOfType <SpellDatabase>(); startingPoint = transform.position; anim = GetComponent <Animator>(); rm = FindObjectOfType <RespawnManager>(); ailmentHandler = GetComponent <AilmentHandler>(); }
public void Start() { spwn = GameManager.managerWasa.RespawnManage; GameManager.managerWasa.SetGameStateToMenue(); GameManager.managerWasa.Audio.StartPlayingNewTrack("MainMenue"); if (GameManager.managerWasa.GameFinished) { CreditsDisplay(); } }
private void Awake() { instance = this; size = spawnPoints.Length; locations = new SpawnLocation[size]; for (int i = 0; i < size; i++) { locations[i] = new SpawnLocation(spawnPoints[i]); } }
void RecipiePassed() { messageText.DisplayMessage(victoryStrings[Random.Range(0, victoryStrings.Length)], currentRecipie.name); Instantiate(victoryEffectsPrefab, cauldronSurfaceRenderer.transform.position, Quaternion.identity); if (currentRecipie.resultPotionPrefab) { RespawnManager respawner = FindObjectOfType <RespawnManager> (); GameObject resultingPotion = (GameObject)Instantiate(currentRecipie.resultPotionPrefab, transform.position, transform.rotation); respawner.Respawn(resultingPotion); } DeselectBook(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void Awake() { // Set this class as Singleton if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
void Start() { playerNlg = GameObject.Find("Player").GetComponent <NLGManager>(); wBoxEnemy.SetActive(false); enemyRgdBdy = GetComponent <Rigidbody2D>(); RangeA = transform.position.x + rangeRadius; RangeB = transform.position.x - rangeRadius; SpawnX = transform.position.x; SpawnY = transform.position.y; audioMast = AudioMaster.instance; respawnScript = GameObject.Find("mournerCircle").GetComponent <RespawnManager>(); }
public static void Prefix(Intercom __instance) { if (!SanyaPlugin.Instance.Config.IntercomInformation) { return; } int leftdecont = (int)Math.Truncate((DecontaminationController.Singleton.DecontaminationPhases[DecontaminationController.Singleton.DecontaminationPhases.Length - 1].TimeTrigger) - Math.Truncate(DecontaminationController.GetServerTime)); int leftautowarhead = AlphaWarheadController.Host != null ? (int)Mathf.Clamp(AlphaWarheadController.Host._autoDetonateTime - (AlphaWarheadController.Host._autoDetonateTime - AlphaWarheadController.Host._autoDetonateTimer), 0, AlphaWarheadController.Host._autoDetonateTimer) : -1; int nextRespawn = (int)Math.Truncate(RespawnManager.CurrentSequence() == RespawnManager.RespawnSequencePhase.RespawnCooldown ? RespawnManager.Singleton._timeForNextSequence - RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds : 0); bool isContain = PlayerManager.localPlayer.GetComponent <CharacterClassManager>()._lureSpj.allowContain; bool isAlreadyUsed = OneOhSixContainer.used; leftdecont = Mathf.Clamp(leftdecont, 0, leftdecont); string contentfix = string.Concat( $"作戦経過時間 : {RoundSummary.roundTime / 60:00}:{RoundSummary.roundTime % 60:00}\n", $"残存SCPオブジェクト : {RoundSummary.singleton.CountTeam(Team.SCP):00}/{RoundSummary.singleton.classlistStart.scps_except_zombies:00}\n", $"残存Dクラス職員 : {RoundSummary.singleton.CountTeam(Team.CDP):00}/{RoundSummary.singleton.classlistStart.class_ds:00}\n", $"残存研究員 : {RoundSummary.singleton.CountTeam(Team.RSC):00}/{RoundSummary.singleton.classlistStart.scientists:00}\n", $"AlphaWarheadのステータス : {(AlphaWarheadOutsitePanel.nukeside.enabled ? "READY" : "DISABLED")}\n", $"SCP-106再収容設備:{(isContain ? (isAlreadyUsed ? "使用済み" : "準備完了") : "人員不在")}\n", $"軽度収容区画閉鎖まで : {leftdecont / 60:00}:{leftdecont % 60:00}\n", $"自動施設爆破開始まで : {leftautowarhead / 60:00}:{leftautowarhead % 60:00}\n", $"接近中の部隊突入まで : {nextRespawn / 60:00}:{nextRespawn % 60:00}\n\n" ); if (__instance.Muted) { contentfix += "アクセスが拒否されました"; } else if (Intercom.AdminSpeaking) { contentfix += $"施設管理者が放送設備をオーバーライド中"; } else if (__instance.remainingCooldown > 0f) { contentfix += $"放送設備再起動中 : 残り{Mathf.CeilToInt(__instance.remainingCooldown)}秒"; } else if (__instance.speaker != null) { contentfix += $"{Player.Get(__instance.speaker).Nickname}が放送中... : 残り{Mathf.CeilToInt(__instance.speechRemainingTime)}秒"; } else { contentfix += "放送設備準備完了"; } __instance.CustomContent = contentfix; return; }
void Awake() { gc = this; titleText = editorTitleText; DontDestroyOnLoad(this); dialogueUI = GetComponentInChildren <DialogueUI>(); signUI = GetComponentInChildren <SignUI>(); pc = GetComponentInChildren <PlayerController>(); rm = GetComponent <RespawnManager>(); playerFollower = gc.GetComponentInChildren <PlayerFollower>(); save = gc.GetComponent <Save>(); blackoutUI = GetComponentInChildren <BlackFadeUI>(); }
SpriteRenderer spriteRenderer; // temp void Start() { respawnManager = FindObjectOfType <RespawnManager>(); spriteRenderer = GetComponent <SpriteRenderer>(); maxHealth = BaseMaxHealth; health = BaseMaxHealth; isDead = false; if (BaseMaxHealth < 0) { Debug.LogWarning("Player Base Health is negative."); } }
private void OnTriggerEnter(Collider other) { if (isActive) { return; } if (other.CompareTag("Player")) { RespawnManager manager = FindObjectOfType <RespawnManager>(); manager.currentPoint = this; SetActive(); } }
private void UpdateRespawnCounter() { if (!RoundSummary.RoundInProgress() || player.Role != RoleType.Spectator) { return; } if (RespawnManager.CurrentSequence() == RespawnManager.RespawnSequencePhase.RespawnCooldown || RespawnManager.CurrentSequence() == RespawnManager.RespawnSequencePhase.PlayingEntryAnimations) { _respawnCounter = (int)Math.Truncate(RespawnManager.Singleton._timeForNextSequence - RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds); } else { _respawnCounter = 0; } }
public virtual void PlayPauseButtonClicked() { if (!Won) { MMVibrationManager.Haptic(HapticTypes.Selection); if (Player.Alive) { SetPause(!Paused); } else { RespawnManager.RespawnPlayer(); StartTimer(); } } }
void Start() { currentHealth = startingHealth; originRotation = transform.rotation; //Shield Amount startingShield = startingHealth * 0.75f; currShield = startingShield; //Health UI Components healthImg = healthUI.healthUI; shieldImage = healthUI.shieldUI; healthCanvas = healthUI.healthCanvas; //GameManager Components mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>(); timer = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<Timer>(); respawnManager = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<RespawnManager>(); }
// Use this for initialization void Start() { PadreScript = GameObject.FindGameObjectWithTag ("SpawnManager").GetComponent<RespawnManager> (); }
// Use this for initialization void Start () { respawnManager = FindObjectOfType<RespawnManager>(); }
void Start() { _instance = this; }
void Start() { //Auto Hooks currCheckpoint = GameObject.Find("startCP"); player = FindObjectOfType<MasterController>(); healthManager = FindObjectOfType<HealthManager>(); respawnManager = FindObjectOfType<RespawnManager>(); timerManager = FindObjectOfType<TimerManager>(); //Game Data GameOptionData.currentLevel = Application.loadedLevel; //Camera Effects mainCamera = FindObjectOfType<Camera>(); cameraSize = mainCamera.orthographicSize; zoomOutDuration = playerRespawnDelay * 0.35f; zoomInDuration = playerRespawnDelay; if(Application.loadedLevel == 7) { defaultCameraSize = 7.0f; } else { defaultCameraSize = mainCamera.orthographicSize; } cameraZoomInEffect = false; cameraZoomOutEffect = false; //Optional HUD Information //Enemy Count, XP Gems Remaining //levelXPGems = GameObject.FindGameObjectsWithTag("XP Gem"); //arraySize = GameObject.FindObjectsOfType<EnemyHealthManager>().Length; //enemyPositionArray = new Vector3[arraySize]; }
// Use this for initialization void Start () { m_RespawnManager = GameObject.FindGameObjectWithTag ("RespawnManager").GetComponent<RespawnManager> (); if (m_RespawnManager == null) { m_LobbySpawn = GameObject.FindGameObjectWithTag ("RespawnManager").GetComponent<LobbySpawn> (); } }
void Awake(){ manager = FindObjectOfType<RespawnManager> (); }