コード例 #1
0
    public void Reload()
    {
        string path = "Assets/Resources/_LevelData.asset";
        savedMotions = (_LevelData)AssetDatabase.LoadAssetAtPath(path, typeof(_LevelData));

        motionController = (MotionController)target;
        motionController.Clear();

        if (motionController.selectionIndex > 0 && motionController.selectionIndex < savedMotions.motions.Count) {
            motionController.Load(savedMotions.motions[motionController.selectionIndex-1]);
            minFrame = 1;
            maxFrame = motionController.frames.Count - 1;
        }
        else {
            motionController.selectionIndex = 0;
        }

        motionNames = new string[savedMotions.motions.Count + 1];
        motionNames[0] = "[Select a Motion]";
        for (int i = 0; i < savedMotions.motions.Count; i++) {
            motionNames[i+1] = savedMotions.motions[i].name;
        }
    }