public void SetBodyType(PC.BODY_TYPE id)
    {
        switch (id.ToString())
        {
        case "BT01":
        {
            this.RGL_LOD0.SetActive(true);
            this.FAT_LOD0.SetActive(false);
            break;
        }

        case "BT02":
        {
            this.RGL_LOD0.SetActive(false);
            this.FAT_LOD0.SetActive(true);
            break;
        }

        default:
        {
            this.RGL_LOD0.SetActive(false);
            this.FAT_LOD0.SetActive(false);
            break;
        }
        }
    }
Exemplo n.º 2
0
    public void SetBodyType(Toggle id)
    {
        try
        {
            PC.BODY_TYPE name = (PC.BODY_TYPE)Enum.Parse(typeof(PC.BODY_TYPE), id.name, true);
            if (id.isOn)
            {
                this.PC_CC.selectedBodyType = name;
                Debug.Log(string.Format("{0} was turned on", name));
            }
            else
            {
                this.PC_CC.selectedBodyType = PC.BODY_TYPE.normal;
                Debug.Log(string.Format("{0} was turned off", name));
            }
        }
        catch
        {
            // if the value passed is not in the enumeration set it to none
            this.PC_CC.selectedBodyType = PC.BODY_TYPE.normal;
            Debug.Log("Body Type Enumeration Not Found!");
        }

        switch (id.name)
        {
        case "BT01":
        {
            this.RGL_LOD0.SetActive(id.isOn);
            this.FAT_LOD0.SetActive(false);
            break;
        }

        case "BT02":
        {
            this.RGL_LOD0.SetActive(false);
            this.FAT_LOD0.SetActive(id.isOn);
            break;
        }

        default:
        {
            this.RGL_LOD0.SetActive(false);
            this.FAT_LOD0.SetActive(false);
            break;
        }
        }
    }