void Start()
    {
        _iKTargetList    = GameObject.Find("IKManager").GetComponent <IKManager>().HandIKList;
        _pianoController = GameObject.Find("Piano").GetComponent <PianoController>();
        _targetAnim      = _targetModel.GetComponent <Animator>();

        //  指先のGameObjectをHumanBodyBonesから取得
        _fingertip    = new GameObject[12];
        _fingertip[0] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.LeftLittleDistal).gameObject);
        _fingertip[1] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.LeftRingDistal).gameObject);
        _fingertip[2] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.LeftMiddleDistal).gameObject);
        _fingertip[3] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.LeftIndexDistal).gameObject);
        _fingertip[4] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.LeftThumbDistal).gameObject);
        _fingertip[5] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.RightThumbDistal).gameObject);
        _fingertip[6] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.RightIndexDistal).gameObject);
        _fingertip[7] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.RightMiddleDistal).gameObject);
        _fingertip[8] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.RightRingDistal).gameObject);
        _fingertip[9] = GetDeepestChildren(_targetAnim.GetBoneTransform(HumanBodyBones.RightLittleDistal).gameObject);

        //  手首のGameObjectをHumanBodyBonesから取得
        _fingertip[10] = _targetAnim.GetBoneTransform(HumanBodyBones.LeftHand).gameObject;
        _fingertip[11] = _targetAnim.GetBoneTransform(HumanBodyBones.RightHand).gameObject;

        //  キャラクター演奏アニメーションの初期設定
        PlayHandInitialize();
    }
示例#2
0
        public MainWindow()
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            PianoController pC = new PianoController()
            {
            };

            SheetController sC = new SheetController();
            MidiController  mC = new MidiController();

            sC.MidiController = mC;

            kC = new KeyboardController()
            {
                PianoController = pC
            };
            mPc = new MusicPieceController()
            {
                Piano = pC, SheetController = sC, MidiController = mC, KeyboardController = kC
            };

            //mPc.Guide.Start();
            DrawMenu();
            InitializeComponent();
            Show();
        }
示例#3
0
        public MusicPieceController GetMusicPieceController()
        {
            PianoController      pC  = new PianoController();
            MusicPieceController mPc = new MusicPieceController()
            {
                Piano = pC
            };

            return(mPc);
        }
示例#4
0
    void Start()
    {
        Controller = GetComponent <PianoController>();

        GameObject midiPlayer = GameObject.Find("MIDIPlayer");

        Player = midiPlayer.GetComponent <MIDIPlayer>();

        Player.ChannelMessagePlayed += onChannelMessagePlayed;
    }
示例#5
0
    public override void OnInspectorGUI()
    {
        PianoController t = target as PianoController;

        if (GUILayout.Button("Reset Keys"))
        {
            t.resetKeys();
        }

        for (int index = 21; index <= 108; ++index)
        {
            float angle = t.getKeyPosition(index);
            angle = EditorGUILayout.Slider(index.ToString(), angle, 0, 1);
            angle = Mathf.Max(Mathf.Min(angle, 1), 0);
            t.setKeyPosition(index, angle);
        }
    }
示例#6
0
	void Awake() {
		Instance = this;
	}