コード例 #1
0
 public void HandleGate(int num)
 {
     if (gate == null)
     {
         gate = gameObject.AddComponent <ManaGate>();
     }
     gate.GateNum = num;
 }
コード例 #2
0
            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);
            }