Beispiel #1
0
    AnimationClipEx GetPostureData(_SourceItemData item)
    {
        AnimationClipEx postureClip = null;

        if (!poseTable.ContainsKey(item))
        {
            AssetBundle ab = AssetBundle.CreateFromFile(item.isTempLoaded ? item.TempLocalPath : item.DecorationLocalPath);

            postureClip = ab.Load("anime") as AnimationClipEx;

            if (postureClip != null)
            {
                poseTable.Add(item, postureClip);
                Debug.Log("Clip is " + (postureClip.animationClip == null) + "?\n" + postureClip.ToString());
            }
            else
            {
                Debug.Log("AssetBundle Load \"anime\" is back NULL!!!");
            }

            ab.Unload(false);
        }
        else
        {
            postureClip = poseTable[item];
        }
        return(postureClip);
    }
Beispiel #2
0
    public void UpdatePosture(_SourceItemData item, bool toSelect, bool isInitial)
    {
        AnimationClipEx postureData = GetPostureData(item);

        if (postureData == null)
        {
            Debug.Log("The AnimationClipEx is NULL!!!");
            return;
        }

        Debug.Log("Clip is " + (postureData.animationClip == null) + "?\n" + postureData.ToString());

        ///Show
        if (toSelect)
        {
//			Debug.Log ("Accessory Selected !");
            if (postureData == currentPoseClip)
            {
//				Debug.Log ("There must be something wrong!");
                return;
            }
            else
            {
                if (isInitial)
                {
                    initialPoseClip = postureData;
//					Debug.Log (item.title + "Set Posture to default");
                }

                currentPoseClip = postureData;
            }

            ///Hide
        }
        else
        {
//			Debug.Log ("Accessory Reselesed !");
            if (postureData == currentPoseClip)
            {
                currentPoseClip = initialPoseClip;
            }
            else
            {
//				Debug.Log ("There must be something else wrong!");
            }
        }

//		UpdateAnimationClip(currentPoseClip);
    }