using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class DoorList : MonoBehaviour
{
///
/// Door model list
///
///
public TMP_Dropdown _DoorModel;
public TMP_Dropdown _Colors;
public TMP_Dropdown _YourList;
public GameObject _Plus;
public GameObject _Minus;
public GameObject _AllModels;
public void OpenPNL(){
print("Create door list");
GameObject OptionPnl=Get.o2("CABCREATORpnl","OPTIONS");
Set.alpha(OptionPnl,false);
GameObject DoorListPnl=Get.o2("CABCREATORpnl","DOORLIST");
Set.alpha(DoorListPnl,true);
DoorListPnl.transform.localPosition=new(20,0,0);
//Add Model
AddDoorModelToList();
AddColorsToList();
AddSelectionToYourList();
}
public void AddDoorModelToList(){
print("Add Door door list");
List L= UIT.GetLibrary("Door");
List listDoorModel = new();
string DoorID="";
int ind_uniqueName=UIT.Ind(Library.Door,Header.Unique_Name);
for(int i=1; i L= UIT.GetLibrary(Library.CabTexture);
List listColors= new();
string CabTextureID="";
int ind_uniqueName=UIT.Ind(Library.Door,Header.Unique_Name);
int ind_DoorColors=UIT.Ind(Library.Door,Header.ColorID);
string DoorModelOnDropDown =_DoorModel.options[0].text;
print("DDoorModelOnDropDown=="+DoorModelOnDropDown);
print("ind_uniqueName=="+ind_uniqueName);
print("ind_DoorColors=="+ind_DoorColors);
string DoorID="";
string DoorColorIDAvailable="";
for(int i=1; i<_G.UIT_LibraryDoors.Count; i++)
{
DoorID=_G.UIT_LibraryDoors[i].Split(',')[0];
if(!string.IsNullOrEmpty(DoorID)){
if(_G.UIT_LibraryDoors[i].Split(',')[ind_uniqueName]==DoorModelOnDropDown ) {
DoorColorIDAvailable=_G.UIT_LibraryDoors[i].Split(',')[ind_DoorColors];
continue;
}
}
}
string[] DoorColorIDAvailableSplit= DoorColorIDAvailable.Split('_');
print("DoorColorIDAvailableD=="+DoorColorIDAvailable);
//All
//1_2_3
if(DoorColorIDAvailable=="All")
{
for(int i=1; i NewList=new ();
if(YourListDropDown.IndexOf("Option")!=-1){
NewList.Add("All Doors");
_YourList.options.Clear();
_YourList.AddOptions(NewList);
}
}
public void PlusClick(){}
public void MinusClick(){}
}