示例#1
0
 // 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>();
 }
示例#2
0
    // 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>();
    }
示例#3
0
    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;
    }
示例#4
0
 void Awake()
 {
     Instance = this;
 }