예제 #1
0
        private void SelectRecord(int id)
        {
            selectedRecord = id;

            propRecord = propTable.GetRecord(id);

            bodyStrucSelected = bodyStrucList.FindIndex(x => x.ID == propRecord.IDBodyStructure);

            FilterSlots(bodyStrucSelected);

            selectedSlot = bodyStrucSlots.FindIndex(x => x.IDSlot == propRecord.IDSlot);

            //Update models list
            List <PropTable.PropModels> mList = propTable.GetModelsList(selectedRecord);

            for (int i = 0; i < mList.Count; i++)
            {
                ModelPrefab tRec = modelsList.Find(x => x.IDSubtype == mList [i].IDBodySubtype);
                tRec.PrefabName = mList [i].ModelName;

                //Try to find the object
                GameObject prefabToLoad = (GameObject)Resources.Load(_config.GetPathName(CSConfig.PathTypeEnum.PropPath) + "/" + tRec.PrefabName);
                if (prefabToLoad != null)
                {
                    tRec.Prefab         = prefabToLoad;
                    tRec.PrefabSelected = prefabToLoad;
                }
                else
                {
                    tRec.PrefabError = true;
                }
            }

            flagEdit = 2;
        }
예제 #2
0
        private void NewRecord()
        {
            propRecord = new PropTable.Prop();

            flagEdit          = 1;
            selectedRecord    = 0;
            bodyStrucSelected = -1;
            bodyStructIndex   = 0;
        }