public void Start() { if (dashMultiplyer == 0) { dashMultiplyer = 2.5f; } animator = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); dashController = GetComponent <DashController>(); sanitySystem = this.GetComponentInChildren <SanitySystem>(); }
// Use this for initialization void Start() { trailback = 0; lastPos = this.gameObject.transform.position; speedCheck = 0.0f; currTarget = 1; lastTarget = 1; playerObject = GameObject.Find("Player"); if (playerObject != null) { sanitySystem = playerObject.GetComponentInChildren <SanitySystem>(); } GameMgr = GameObject.Find("_GameManager").GetComponent <GameMgr>(); }
public void Start() { audioSource = GetComponent <AudioSource>(); lightComponent = GetComponentInChildren <Light>(); proximityMessage = GetComponent <ProximityMessage>(); monsterGracePeriod = 0.0f; monsterNear = false; originalIntensity = lightComponent.intensity; child = transform.GetComponentInChildren <CeilingLightChild>(); player = GameObject.Find("Player"); playersInventory = player.GetComponent <Inventory>(); playersSanitySystem = player.transform.Find("Player top light").GetComponent <SanitySystem>(); CircleCollider2D[] allColliders = GetComponentsInChildren <CircleCollider2D>(); foreach (CircleCollider2D collider in allColliders) { if (collider.gameObject.name == "MonsterCollider") { monsterCollider = collider; } } timedMessage = GetComponent <TimedMessage>(); if (StartWithLightBulb) { SpawnLightBulb(StartLightBulbLifetime); } monsterCollider.enabled = StartWithLightBulb; SetProximityMessage(); progressBar = GameObject.Find("/Canvas/ChangeLightProgressBar"); progressBarImg = progressBar.GetComponent <Image>(); progressBarImg.fillAmount = 0; }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); sanity = GameObject.Find("Units/Player/Player top light").GetComponent <SanitySystem>(); }