Exemplo n.º 1
0
 void AddWeaponItem(ItemData it, int idx)
 {
     if (GridWeapon.Count > idx)
     {
         GridWeapon[idx].SetActive(true);
         UIFunCtrl ctrl = GridWeapon[idx].GetComponent <UIFunCtrl>();
         ctrl.SetEvent(ShowWeapon, it.Key);
         WeaponData weaponProperty = U3D.GetWeaponProperty(it.UnitId);
         ctrl.SetText(weaponProperty.Name);
     }
     else
     {
         GameObject weapon = GameObject.Instantiate(Resources.Load("GridItemBtn")) as GameObject;
         UIFunCtrl  obj    = weapon.AddComponent <UIFunCtrl>();
         obj.SetEvent(ShowWeapon, it.Key);
         WeaponData weaponProperty = U3D.GetWeaponProperty(it.UnitId);
         obj.SetText(weaponProperty.Name);
         obj.transform.SetParent(WeaponRoot.transform);
         obj.gameObject.layer        = WeaponRoot.layer;
         obj.transform.localScale    = Vector3.one;
         obj.transform.localPosition = Vector3.zero;
         obj.transform.localRotation = Quaternion.identity;
         GridWeapon.Add(weapon);
     }
 }
Exemplo n.º 2
0
    void AddWeaponItem(ItemBase it)
    {
        UIFunCtrl obj = (GameObject.Instantiate(Resources.Load("UIFuncItem")) as GameObject).GetComponent <UIFunCtrl>();

        obj.SetEvent(ChangeWeaponCode, it.Idx);
        obj.SetText(it.Name);
        obj.transform.SetParent(WeaponRoot.transform);
        obj.gameObject.layer        = WeaponRoot.layer;
        obj.transform.localScale    = Vector3.one;
        obj.transform.localPosition = Vector3.zero;
        obj.transform.localRotation = Quaternion.identity;
    }
Exemplo n.º 3
0
    void AddSpawnItem(int Idx)
    {
        UIFunCtrl obj = (GameObject.Instantiate(Resources.Load("UIFuncItem")) as GameObject).GetComponent <UIFunCtrl>();

        obj.SetEvent(SpawnMonster, Idx);
        obj.SetText(Global.model[Idx]);
        obj.transform.SetParent(FunctionRoot.transform);
        obj.gameObject.layer        = FunctionRoot.layer;
        obj.transform.localScale    = Vector3.one;
        obj.transform.localPosition = Vector3.zero;
        obj.transform.localRotation = Quaternion.identity;
    }
Exemplo n.º 4
0
    void AddModel(int Idx)
    {
        UIFunCtrl obj = (GameObject.Instantiate(Resources.Load("GridItemBtn")) as GameObject).AddComponent <UIFunCtrl>();

        obj.SetEvent(ChangeModel, Idx);
        obj.SetText(Main.Ins.CombatData.GetCharacterName(Idx));
        obj.transform.SetParent(GridViewRoot.transform);
        obj.gameObject.layer        = GridViewRoot.layer;
        obj.transform.localScale    = Vector3.one;
        obj.transform.localPosition = Vector3.zero;
        obj.transform.localRotation = Quaternion.identity;
    }