コード例 #1
0
 public void Add(GunBasic gun)
 {
     if (Guns == null)
     {
         Guns = new List <GunBasic>(1);
     }
     Guns.Add(gun);
     gun.SetParent(this);
 }
コード例 #2
0
        public void SetGun(GunBasic gun)
        {
            if (Guns == null)
            {
                Guns = new List <GunBasic>(1);
                Guns.Add(gun);
            }
            else
            {
                Guns[0] = gun;
            }

            if (gun != null)
            {
                gun.SetParent(this);
            }
        }