using System.Collections; using System.Collections.Generic; using UnityEngine; public class AReadyMachine : Interactive { //控制家里移开水缸后的电报机 public BoxCollider2D m_Collider; void Start() { m_Collider = GetComponent(); m_Collider.enabled = false; } public override void OnCall() { //交互后,改变玩家形象 FindObjectOfType().transform.Find("包").gameObject.SetActive(true); FindObjectOfType().transform.Find("包带").gameObject.SetActive(true); //播放穿上行囊的音效 GetComponent().Play(); //随后删除自己(不要删!不然音效放不出来,我们直接关闭这个物体的碰撞体和图片就可以了) FindObjectOfType().catched = null; // Destroy(gameObject); GetComponent().enabled = false; GetComponent().enabled = false; } }