public void HandleGate(int num) { if (gate == null) { gate = gameObject.AddComponent <ManaGate>(); } gate.GateNum = num; }
private void Awake() { sr = gameObject.AddComponent <SpriteRenderer>(); var tex = GUIController.Instance.images["seal_wall"]; sr.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)); gameObject.AddComponent <BoxCollider2D>().size = new Vector2(1, 4.5f); gameObject.layer = 0; // 8 if (gate == null) { gate = gameObject.AddComponent <ManaGate>(); } gate.Open = () => Destroy(gameObject); UnVisableBehaviour.AttackReact.Create(gameObject); }