59 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerPressurePlateBossMod: MonoBehaviour
{
public SpriteRenderer spriteRenderer;
public Sprite originalSprite;
public Sprite activatedSprite;
public GameObject[] doors;
private Amboss script;
[SerializeField] int num;
private Transform thepoint;
// Start is called before the first frame update
void Start()
{
script = GameObject.Find("DimAll").GetComponent<Amboss>();
thepoint = GameObject.Find("RespawnProjectile").transform;
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter2D(Collider2D other) {
spriteRenderer.sprite = activatedSprite;
foreach (var door in doors)
{
door.SetActive(false);
}
thepoint.transform.SetPositionAndRotation(gameObject.transform.position + new Vector3(0,1,0),Quaternion.identity);
switch (num)
{
case 1: script.one = true;
break;
case 2: script.two = true;
break;
case 3: script.three = true;
break;
case 4: script.four = true;
break;
default: break;
}
Destroy(gameObject.GetComponent<EdgeCollider2D>());
}
}