예제 #1
0
 void Init()
 {
     weaponSubType = EquipWeaponType.Sword;
     if (CameraForWeapon == null)
     {
         CameraForWeapon = GameObject.Instantiate(ResMng.LoadPrefab("CameraForWeapon")) as GameObject;
         CameraForWeapon.Identity(null);
         WeaponModelParent = Control("WeaponParent", CameraForWeapon);
         wload             = WeaponModelParent.GetComponent <WeaponLoader>();
         wload.Init();
     }
     WeaponRoot = Control("WeaponRoot");
     Control("Equip").GetComponent <Button>().onClick.AddListener(() => { ChangeWeaponCode(); });
     Control("Close").GetComponent <Button>().onClick.AddListener(OnBackPress);
     for (int i = 0; i < 12; i++)
     {
         string control = string.Format("Tab{0}", i);
         Control(control).GetComponent <UITab>().onValueChanged.AddListener(ChangeWeaponType);
     }
     if (load == null)
     {
         load = Main.Ins.StartCoroutine(AddWeapon());
     }
 }