// Start is called before the first frame update protected override void Start() { base.Start(); ai = GetComponentInParent <AI_BossSnake>(); effectsStorage = GetComponentInParent <EffectsStorage>(); bodySr = transform.parent.Find("BossSnakeSprite").GetComponent <SpriteRenderer>(); }
// Start is called before the first frame update void Start() { headTransform = transform.Find("Snake").Find("SnakeHead"); headDamageable = headTransform.GetComponent <BossDamageable>(); Transform tailAttacks = transform.Find("tailAttacks"); foreach (Transform child in tailAttacks) { tailAnimators.Add(child.GetComponentInChildren <Animator>()); } Transform spawnLocations = transform.Find("spawnLocations"); foreach (Transform child in spawnLocations) { spawnTransforms.Add(child); } headAnim = headTransform.GetComponent <Animator>(); tailAnim = transform.Find("Snake").Find("SnakeTailSprite").GetComponent <Animator>(); effectsStorage = GetComponent <EffectsStorage>(); }
void Start() { rb = GetComponent <Rigidbody2D>(); sprite = transform.GetChild(0); sr = sprite.GetComponent <SpriteRenderer>(); particle = GetComponentInChildren <ParticleSystem>().main; damageable = GetComponent <Damageable>(); burningFilter = new ContactFilter2D(); burningFilter.useTriggers = true; burningFilter.SetLayerMask(LayerMask.GetMask("Burning")); // DO NOT use LayerMask.NameToLayer here -- it returns an int instead of bitmask // print("burning filter: " + LayerMask.LayerToName(burningFilter.layerMask)); fireHitbox = transform.GetChild(1).gameObject; animator = sprite.GetComponent <Animator>(); effectsStorage = GetComponent <EffectsStorage>(); effectsStorage.PlayEffect(2); // spawn SFX if (PersistentManager.instance == null) { Instantiate(Utils.persistentManager, Vector3.zero, Quaternion.identity); } volumeProfile.TryGet(out bloom); bloom.intensity.value = 0.5f; }
void Awake() { Instance = this; }