Beispiel #1
0
    private void Awake()
    {
        collection = StyleCollection.getInstance();

        m_hoodDatas  = collection.getCustomizerData(BodyPart.Hood);
        m_headDatas  = collection.getCustomizerData(BodyPart.Head);
        m_torsoDatas = collection.getCustomizerData(BodyPart.Torso);

        m_leftShoulderData  = collection.getCustomizerData(BodyPart.LShoulder);
        m_leftElbowData     = collection.getCustomizerData(BodyPart.LElbow);
        m_leftWristData     = collection.getCustomizerData(BodyPart.LWrist);
        m_rightShoulderData = collection.getCustomizerData(BodyPart.RShoulder);
        m_rightElbowData    = collection.getCustomizerData(BodyPart.RElbow);
        m_rightWristData    = collection.getCustomizerData(BodyPart.RWrist);

        m_pelvisDatas = collection.getCustomizerData(BodyPart.Pelvis);

        m_leftLegData   = collection.getCustomizerData(BodyPart.LLeg);
        m_leftBootData  = collection.getCustomizerData(BodyPart.LBoot);
        m_rightLegData  = collection.getCustomizerData(BodyPart.RLeg);
        m_rightBootData = collection.getCustomizerData(BodyPart.RBoot);

        hoodCustomizerFieldController.addCustomizerData(m_hoodDatas);
        headCustomizerFieldController.addCustomizerData(m_headDatas);
        armCustomizerFieldController.addCustomizerData(m_leftShoulderData);
        armCustomizerFieldController.addCustomizerData(m_leftElbowData);
        armCustomizerFieldController.addCustomizerData(m_leftWristData);
        armCustomizerFieldController.addCustomizerData(m_rightShoulderData);
        armCustomizerFieldController.addCustomizerData(m_rightElbowData);
        armCustomizerFieldController.addCustomizerData(m_rightWristData);
        torsoCustomizerFieldController.addCustomizerData(m_torsoDatas);
        pelvisCustomizerFieldController.addCustomizerData(m_pelvisDatas);
        legCustomizerFieldController.addCustomizerData(m_leftLegData);
        legCustomizerFieldController.addCustomizerData(m_leftBootData);
        legCustomizerFieldController.addCustomizerData(m_rightLegData);
        legCustomizerFieldController.addCustomizerData(m_rightBootData);
    }
Beispiel #2
0
    public CustomizerData loadAssets(BodyPart bodyPart)
    {
        List <string>     availableAssetNames   = new List <string>();
        List <SpriteMesh> availableSpriteMeshes = new List <SpriteMesh>();

        var availableDescriptions = m_meshDescriptions[bodyPart];
        var assetBundle           = m_meshBundles[bodyPart];

        foreach (var description in availableDescriptions)
        {
            var assetName  = description.fullName;
            var spriteMesh = assetBundle.LoadAsset <SpriteMesh>(assetName);
            if (spriteMesh == null)
            {
                Debug.Log("Failed to load asset " + assetName);
            }
            availableAssetNames.Add(assetName);
            availableSpriteMeshes.Add(spriteMesh);
        }

        CustomizerData result = new CustomizerData(availableAssetNames, availableSpriteMeshes);

        return(result);
    }
 public void addCustomizerData(CustomizerData data)
 {
     m_customizerDatas.Add(data);
     updateText();
 }