void Start() { if (ins != null) { DestroyImmediate(this.gameObject); return; } DontDestroyOnLoad(gameObject); ins = this; }
IEnumerator Hulc() { while (true) { if (HallucinationNow) { DDDDD hal = Instantiate(hallucinationObj, transform.position + new Vector3(0, 0, 1), Quaternion.Euler(Vector2.zero)).GetComponent <DDDDD>(); hal.Downd = HallucinationTime1; hal.Black = HallucinationBlock; hal.GetComponent <SpriteRenderer>().sprite = transform.GetChild(0).GetComponent <SpriteRenderer>().sprite; hal.transform.localScale = transform.GetChild(0).lossyScale; } yield return(new WaitForSeconds(HallucinationTime)); } }