private void Start() { timer2 = timer; player = MetaScript.getPlayer(); buildingCheck = player.GetComponent <InBuilding>(); controls = MetaScript.GetControls(); }
private void heatExhaust(GameObject victim) { InBuilding shelterCheck = victim.GetComponent <InBuilding>(); if (shelterCheck == null || !shelterCheck.getPlayerInBuilding()) { victim.GetComponent <Health>().damage(damagePerTick); } }
protected virtual void slow(GameObject victim) { InBuilding shelterCheck = victim.GetComponent <InBuilding>(); if (shelterCheck == null || !shelterCheck.getPlayerInBuilding()) { buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal); } }
private void setBuildingCheckOnNPC(GameObject npc, bool val) { InBuilding buildingCheck = npc.GetComponent <InBuilding>(); if (buildingCheck == null) { buildingCheck = npc.AddComponent <InBuilding>(); } buildingCheck.setPlayerInBuilding(val); }
protected override void slow(GameObject victim) { if (!MetaScript.getGlobal_Stats().getHasHeatProtection()) { InBuilding shelterCheck = victim.GetComponent <InBuilding>(); if (shelterCheck == null || !shelterCheck.getPlayerInBuilding()) { buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal); } } }
private bool checkIfInBuilding(GameObject victim) { InBuilding buildingCheck = victim.GetComponent <InBuilding>(); if (buildingCheck == null) { return(false); } else { return(buildingCheck.getPlayerInBuilding()); } }
// Update is called once per frame void Update() { InBuilding shelterCheck = gameObject.GetComponentInParent <InBuilding>(); if (shelterCheck == null || !shelterCheck.getPlayerInBuilding()) { timeFromLastSpawn += Time.deltaTime; if (timeFromLastSpawn >= timeToNextSpawn) { float angle = Random.Range(0, 2 * Mathf.PI); float radius = Random.Range(minRadius, maxRadius); Vector3 pos = gameObject.transform.position; pos.x += radius * Mathf.Cos(angle); pos.z += radius * Mathf.Sin(angle); pos.y = 0.0000001f; Instantiate(trap, pos, Quaternion.identity, null); timeFromLastSpawn = 0; timeToNextSpawn = Random.Range(minSecondsBetweenSpawns, maxSecondsBetweenSpawns); } } }