1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347
| using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class UIScript : MonoBehaviour { [Header("模型")] [SerializeField] private GameObject playerEl; [SerializeField] private GameObject playerSp; [SerializeField] private GameObject playerRust;
[Header("正在播放")] [SerializeField] private TextMeshProUGUI tmpText;
[Header("环境光")] [SerializeField] private Slider _LightSlider; [SerializeField] private Light _DirectionalLight; [SerializeField] private Light centerPointLight;
[Header("衣服颜色 For Elinyaa")] [SerializeField] private Material Cloth_Material; [SerializeField] private Texture texGold; [SerializeField] private Texture texPurple; [SerializeField] private Texture texBlue; [SerializeField] private Texture texPink;
[Header("衣服 For Elinyaa")] [SerializeField] private SkinnedMeshRenderer eyeHeart; [SerializeField] private GameObject cloth; [SerializeField] private GameObject clothCollar; [SerializeField] private GameObject Clothpants; [SerializeField] private GameObject clothSleeve; [SerializeField] private GameObject ClothUnder; [SerializeField] private GameObject Boots; [SerializeField] private GameObject hhat; [SerializeField] private GameObject necklace; [SerializeField] private GameObject Hairpin; [SerializeField] private GameObject socks; [Header("衣服 For Sapphy")] [SerializeField] private SkinnedMeshRenderer eyeHeart_sp; [SerializeField] private GameObject cloth_sp; [SerializeField] private GameObject clothCollar_sp; [SerializeField] private GameObject Clothpants_sp; [SerializeField] private GameObject clothSleeve_sp; [SerializeField] private GameObject ClothUnder_sp; [SerializeField] private GameObject Boots_sp; [SerializeField] private GameObject hhat_sp; [SerializeField] private GameObject socks_sp; [Header("衣服 For Rust")] [SerializeField] private SkinnedMeshRenderer eyeHeart_Rust; [SerializeField] private GameObject cloth_Rust; [SerializeField] private GameObject socks_Rust; [SerializeField] private GameObject boots_Rust;
[Header("相机距离")] [SerializeField] private MMD_VmdCameraLoad mmdCameraDistance; [SerializeField] private MMD_VmdCameraLoad_Sap mmdCameraDistanceSap; [SerializeField] private MMD_VmdCameraLoad_Rust mmdCameraDistanceRust; [SerializeField] private Slider _CamDistanceSlider; [SerializeField] private Slider _CamUpDownSlider; [SerializeField] private Transform CamUpDownObj;
[Header("镜头动作开关")] [SerializeField] private CameraController CamType2;
[Header("场景切换开关")] [SerializeField] private List<GameObject> Stages; //[SerializeField] private GameObject Stage_1_Sakura; //[SerializeField] private GameObject Stage_2_yyl; //[SerializeField] private GameObject Stage_3_candy;
[Header("MMD选择")] [SerializeField] private AudioSource _audiosource; [SerializeField] private Animator anim; [SerializeField] private Animator animSp; [SerializeField] private Animator animRust; [SerializeField] private Transform vmdCam; [SerializeField] MMD_VmdCameraLoad MMD_VMD; [SerializeField] MMD_VmdCameraLoad_Sap MMD_VMD_Sap; [SerializeField] MMD_VmdCameraLoad_Rust MMD_VMD_Rust; // MMD [SerializeField] private AudioClip sound_koi; // 恋爱循环 [SerializeField] private TextAsset VMD_koi; [SerializeField] private AudioClip sound_SingMeToSleep; // Sing Me To Sleep [SerializeField] private TextAsset VMD_SingMeToSleep; [SerializeField] private AudioClip sound_Gwiyomi; // Gwiyomi [SerializeField] private TextAsset VMD_Gwiyomi; [SerializeField] private AudioClip sound_HappyHalloween; // Happy Halloween [SerializeField] private TextAsset VMD_HappyHalloween; [SerializeField] private AudioClip sound_ldsd; // 劣等上等 [SerializeField] private TextAsset VMD_ldsd; [SerializeField] private AudioClip sound_jljt; // 极乐净土 [SerializeField] private TextAsset VMD_jljt; [SerializeField] private AudioClip sound_PinkCat; // PinkCat [SerializeField] private TextAsset VMD_PinkCat; [SerializeField] private AudioClip sound_ELECT; // ELECT [SerializeField] private TextAsset VMD_ELECT; [SerializeField] private AudioClip sound_DreamingChuchu; // Dreaming Chuchu [SerializeField] private TextAsset VMD_DreamingChuchu; [SerializeField] private AudioClip sound_Necomimi; // 猫耳开关 [SerializeField] private TextAsset VMD_Necomimi; [SerializeField] private AudioClip sound_Yumeyume; // Yumeyume [SerializeField] private TextAsset VMD_Yumeyume; [SerializeField] private AudioClip sound_Linngo; // Linngo [SerializeField] private TextAsset VMD_Linngo; [SerializeField] private AudioClip sound_lkyb; // 恋空予报 [SerializeField] private TextAsset VMD_lkyb; [SerializeField] private AudioClip sound_badbadWater; // 我的悲伤是水做的 [SerializeField] private TextAsset VMD_badbadWater; [SerializeField] private AudioClip sound_ツギハギスタッカート; // ツギハギスタッカート [SerializeField] private TextAsset VMD_ツギハギスタッカート;
// R18MMD [SerializeField] private AudioClip sound_Conqueror; // Conqueror [SerializeField] private TextAsset VMD_Conqueror; [SerializeField] private AudioClip sound_PacmanGhosts; // Pac-manGhosts [SerializeField] private TextAsset VMD_PacmanGhosts; [SerializeField] private AudioClip sound_FullBodied; // FullBodied [SerializeField] private TextAsset VMD_FullBodied; [SerializeField] private AudioClip sound_Applepie; // Apple pie [SerializeField] private TextAsset VMD_Applepie; [SerializeField] private AudioClip sound_BubbleButt; // BubbleButt [SerializeField] private TextAsset VMD_BubbleButt; [SerializeField] private AudioClip sound_SwingDance; // SwingDance [SerializeField] private TextAsset VMD_SwingDance; [SerializeField] private AudioClip sound_GoodNightKiss; // GoodNightKiss [SerializeField] private TextAsset VMD_GoodNightKiss; [SerializeField] private AudioClip sound_DojaCat; // Doja Cat [SerializeField] private TextAsset VMD_DojaCat; [SerializeField] private AudioClip sound_DeepBlueTown; // DeepBlueTown [SerializeField] private TextAsset VMD_DeepBlueTown; [SerializeField] private AudioClip sound_Mister; // Mister [SerializeField] private TextAsset VMD_Mister; [SerializeField] private AudioClip sound_Lupin; // Lupin [SerializeField] private TextAsset VMD_Lupin; [SerializeField] private AudioClip sound_HoldDance; // Hold Dance [SerializeField] private TextAsset VMD_HoldDance; [SerializeField] private AudioClip sound_Samsara; // Samsara [SerializeField] private TextAsset VMD_Samsara; [SerializeField] private AudioClip sound_Fireball; // Fireball [SerializeField] private TextAsset VMD_Fireball; [SerializeField] private AudioClip sound_BaamFull; // Baam full [SerializeField] private TextAsset VMD_BaamFull; [SerializeField] private AudioClip sound_DestinationCalabria; // Destination Calabria [SerializeField] private TextAsset VMD_DestinationCalabria; [SerializeField] private AudioClip sound_Lamb; // Lamb [SerializeField] private TextAsset VMD_Lamb; [SerializeField] private AudioClip sound_ExcuseMe; // ExcuseMe [SerializeField] private TextAsset VMD_ExcuseMe; [SerializeField] private AudioClip sound_KillerB; // KillerB [SerializeField] private TextAsset VMD_KillerB; [SerializeField] private AudioClip sound_PushIt; // PushIt [SerializeField] private TextAsset VMD_PushIt;
[SerializeField] private Canvas _canvas;
private void Awake() { Application.targetFrameRate = 60; // 暂停状态初始化 录制时注释 Time.timeScale = 1f; UIShow(); } private void Start() { // 光照值滑块初始化 _LightSlider.value = _DirectionalLight.intensity; //Camera.main.GetComponent<AudioSource>().Stop(); // 相机距离滑块初始化 _CamDistanceSlider.value = mmdCameraDistance.camFieldOfView; _CamUpDownSlider.value = CamUpDownObj.localPosition.y; // NowPlaying初始化 tmpText.text = "Now:" + anim.runtimeAnimatorController.name; // 开始时播放的是哪个mmd MMD_9_DreamingChuchu();
//_audiosource.Play(); //ChangeModel(); // 衣服 录制时开启 //CloPre3_All_ForMovie(); // 录制时若有延迟开启--------------- Invoke("Playmusic", 1.2f); //Playmusic();
} private void Update() { // 按空格键控制UI显隐 if (Input.GetKeyDown(KeyCode.Space)) { UIShow(); } }
public void UIShow() { if (_canvas.gameObject.activeSelf) { _canvas.gameObject.SetActive(false); } else { _canvas.gameObject.SetActive(true); } } private void Playmusic() { _audiosource.Play(); } // 环境光照强度 public void setLight() { _DirectionalLight.intensity = _LightSlider.value; } public void setPointLight() { if (centerPointLight.enabled) { centerPointLight.enabled = false; } else if (!centerPointLight.enabled) { centerPointLight.enabled = true; } } // 衣服颜色 public void ColorGold() { Cloth_Material.SetTexture("_MainTex", texGold); } public void ColorPurple() { Cloth_Material.SetTexture("_MainTex", texPurple); } public void ColorBlue() { Cloth_Material.SetTexture("_MainTex", texBlue); } public void ColorPink() { Cloth_Material.SetTexture("_MainTex", texPink); } // 播放/暂停 public void StartOrStop() { if (Time.timeScale == 0) { Time.timeScale = 1f; _audiosource.Play(); } else if (Time.timeScale == 1f) { Time.timeScale = 0f; _audiosource.Pause(); } } // 衣服 public void EyeHeart() { if (playerEl.activeSelf) { if (eyeHeart.GetBlendShapeWeight(62) == 0) eyeHeart.SetBlendShapeWeight(62, 100); else if (eyeHeart.GetBlendShapeWeight(62) == 100) eyeHeart.SetBlendShapeWeight(62, 0); } else if(playerSp.activeSelf) { if (eyeHeart_sp.GetBlendShapeWeight(67) == 0) eyeHeart_sp.SetBlendShapeWeight(67, 100); else if (eyeHeart_sp.GetBlendShapeWeight(67) == 100) eyeHeart_sp.SetBlendShapeWeight(67, 0); } else if (playerRust.activeSelf) { if (eyeHeart_Rust.GetBlendShapeWeight(173) == 0) eyeHeart_Rust.SetBlendShapeWeight(173, 100); else if (eyeHeart_Rust.GetBlendShapeWeight(173) == 100) eyeHeart_Rust.SetBlendShapeWeight(173, 0);
//for (int i = 0; i < 249; i++) //{ // if (eyeHeart_Rust.GetBlendShapeWeight(i) == 100) // Debug.Log(i); //} } } public void Clothes_cloth() { if (playerEl.gameObject.activeSelf) { if (cloth.activeSelf) cloth.SetActive(false); else if (!cloth.activeSelf) cloth.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (cloth_sp.activeSelf) cloth_sp.SetActive(false); else if (!cloth_sp.activeSelf) cloth_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { if (cloth_Rust.activeSelf) cloth_Rust.SetActive(false); else if (!cloth_Rust.activeSelf) cloth_Rust.SetActive(true); } } public void Clothes_hat() { if (playerEl.gameObject.activeSelf) { if (hhat.activeSelf) hhat.SetActive(false); else if (!hhat.activeSelf) hhat.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (hhat_sp.activeSelf) hhat_sp.SetActive(false); else if (!hhat_sp.activeSelf) hhat_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { return; } } public void Clothes_sleeve() { if (playerEl.gameObject.activeSelf) { if (clothSleeve.activeSelf) clothSleeve.SetActive(false); else if (!clothSleeve.activeSelf) clothSleeve.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (clothSleeve_sp.activeSelf) clothSleeve_sp.SetActive(false); else if (!clothSleeve_sp.activeSelf) clothSleeve_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { return; } } public void Clothes_socks() { if (playerEl.gameObject.activeSelf) { if (socks.activeSelf) socks.SetActive(false); else if (!socks.activeSelf) socks.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (socks_sp.activeSelf) socks_sp.SetActive(false); else if (!socks_sp.activeSelf) socks_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { if (socks_Rust.activeSelf) socks_Rust.SetActive(false); else if (!socks_Rust.activeSelf) socks_Rust.SetActive(true); } } public void Clothes_clothpants() { if (playerEl.gameObject.activeSelf) { if (Clothpants.activeSelf) Clothpants.SetActive(false); else if (!Clothpants.activeSelf) Clothpants.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (Clothpants_sp.activeSelf) Clothpants_sp.SetActive(false); else if (!Clothpants_sp.activeSelf) Clothpants_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { return; } } public void Clothes_boots() { if (playerEl.gameObject.activeSelf) { if (Boots.activeSelf) Boots.SetActive(false); else if (!Boots.activeSelf) Boots.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (Boots_sp.activeSelf) Boots_sp.SetActive(false); else if (!Boots_sp.activeSelf) Boots_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { if (boots_Rust.activeSelf) boots_Rust.SetActive(false); else if (!boots_Rust.activeSelf) boots_Rust.SetActive(true); } } public void Clothes_under() { if (playerEl.gameObject.activeSelf) { if (ClothUnder.activeSelf) ClothUnder.SetActive(false); else if (!ClothUnder.activeSelf) ClothUnder.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (ClothUnder_sp.activeSelf) ClothUnder_sp.SetActive(false); else if (!ClothUnder_sp.activeSelf) ClothUnder_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { return; } } public void Clothes_collar() { if (playerEl.gameObject.activeSelf) { if (clothCollar.activeSelf) clothCollar.SetActive(false); else if (!clothCollar.activeSelf) clothCollar.SetActive(true); } else if (playerSp.gameObject.activeSelf) { if (clothCollar_sp.activeSelf) clothCollar_sp.SetActive(false); else if (!clothCollar_sp.activeSelf) clothCollar_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { return; } } public void CloPre1() { if (playerEl.activeSelf) { cloth.SetActive(true); clothCollar.SetActive(true); Clothpants.SetActive(true); clothSleeve.SetActive(true); ClothUnder.SetActive(true); Boots.SetActive(true); hhat.SetActive(true); necklace.SetActive(true); Hairpin.SetActive(true); socks.SetActive(true); } else if (playerSp.activeSelf) { cloth_sp.SetActive(true); clothCollar_sp.SetActive(true); Clothpants_sp.SetActive(true); clothSleeve_sp.SetActive(true); ClothUnder_sp.SetActive(true); Boots_sp.SetActive(true); hhat_sp.SetActive(true); socks_sp.SetActive(true); } else if (playerRust.gameObject.activeSelf) { cloth_Rust.SetActive(true); socks_Rust.SetActive(true); boots_Rust.SetActive(true); } } public void CloPre2() { if (playerEl.activeSelf) { cloth.SetActive(false); clothCollar.SetActive(false); Clothpants.SetActive(false); clothSleeve.SetActive(false); ClothUnder.SetActive(true); Boots.SetActive(false); hhat.SetActive(false); necklace.SetActive(false); Hairpin.SetActive(false); socks.SetActive(false); } else if (playerSp.activeSelf) { cloth_sp.SetActive(false); clothCollar_sp.SetActive(false); Clothpants_sp.SetActive(false); clothSleeve_sp.SetActive(false); ClothUnder_sp.SetActive(true); Boots_sp.SetActive(false); hhat_sp.SetActive(true); socks_sp.SetActive(false); } else if (playerRust.gameObject.activeSelf) { cloth_Rust.SetActive(false); socks_Rust.SetActive(false); boots_Rust.SetActive(false); } }
private void CloPre3_All_ForMovie() { if (playerEl.activeSelf) { cloth.SetActive(false); clothCollar.SetActive(false); Clothpants.SetActive(false); clothSleeve.SetActive(false); ClothUnder.SetActive(false); Boots.SetActive(false); hhat.SetActive(false); necklace.SetActive(false); Hairpin.SetActive(false); socks.SetActive(false); } else if (playerSp.activeSelf) { cloth_sp.SetActive(false); clothCollar_sp.SetActive(false); Clothpants_sp.SetActive(false); clothSleeve_sp.SetActive(false); ClothUnder_sp.SetActive(false); Boots_sp.SetActive(false); hhat_sp.SetActive(true); socks_sp.SetActive(false); } else if (playerRust.gameObject.activeSelf) { cloth_Rust.SetActive(false); socks_Rust.SetActive(false); boots_Rust.SetActive(false); } } // 相机距离 public void SetCamDistance() { if(mmdCameraDistance.enabled) { mmdCameraDistance.camFieldOfView = _CamDistanceSlider.value; } else if(mmdCameraDistanceSap.enabled) { mmdCameraDistanceSap.camFieldOfView = _CamDistanceSlider.value; } else if(mmdCameraDistanceRust.enabled) { mmdCameraDistanceRust.camFieldOfView = _CamDistanceSlider.value; }
} public void SetCamUpDown() { CamUpDownObj.localPosition = new Vector3(CamUpDownObj.localPosition.x, _CamUpDownSlider.value, CamUpDownObj.localPosition.z); } // 镜头动作开关 public void CamChoose() { if (!CamType2.enabled) { if(playerEl.activeSelf) mmdCameraDistance.enabled = false; else if(playerSp.activeSelf) mmdCameraDistanceSap.enabled = false; else if (playerRust.activeSelf) mmdCameraDistanceRust.enabled = false;
CamType2.enabled = true; } else if (CamType2.enabled) { if(playerEl.activeSelf) mmdCameraDistance.enabled= true; else if(playerSp.activeSelf) mmdCameraDistanceSap.enabled = true; else if (playerRust.activeSelf) mmdCameraDistanceRust.enabled = true; CamType2.enabled = false; } } // 场景切换 public void StageChoose() { //if (Stage_1_Sakura.activeSelf) //{ // Stage_2_yyl.SetActive(true); // Stage_1_Sakura.SetActive(false); //} //else if(Stage_2_yyl.activeSelf) //{ // Stage_3_candy.SetActive(true); // Stage_2_yyl.SetActive(false); //} //else if (Stage_3_candy.activeSelf) //{ // Stage_1_Sakura.SetActive(true); // Stage_3_candy.SetActive(false); //}
for (int i = 0; i < Stages.Count; i++) { if (Stages[i].activeSelf) { Stages[(i == Stages.Count - 1) ? 0 : i + 1].SetActive(true); Stages[i].SetActive(false); return; } } } // 模型切换 public void ChangeModel() { if (playerEl.activeSelf) { MMD_VMD.enabled = false; playerSp.SetActive(true); playerSp.transform.localPosition = new Vector3(0, 0, 0); playerSp.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); animSp.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(anim.runtimeAnimatorController.name); animSp.runtimeAnimatorController = (RuntimeAnimatorController)animator;
playerEl.SetActive(false); //playerRust.SetActive(false);
MMD_VMD_Sap.enabled = true;
if(Time.timeScale == 1f) { _audiosource.Stop(); _audiosource.Play(); } else if(Time.timeScale == 0f) { _audiosource.Stop(); } mmdChange(animSp.runtimeAnimatorController.name, _audiosource.clip, MMD_VMD.Select_VMD); } else if (playerSp.activeSelf) { MMD_VMD_Sap.enabled = false;
playerRust.SetActive(true); playerRust.transform.localPosition = new Vector3(0, 0, 0); playerRust.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); animRust.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(animSp.runtimeAnimatorController.name); animRust.runtimeAnimatorController = (RuntimeAnimatorController)animator; playerSp.SetActive(false); //playerRust.SetActive(false);
MMD_VMD_Rust.enabled = true; if (Time.timeScale == 1f) { _audiosource.Stop(); _audiosource.Play(); } else if (Time.timeScale == 0f) { _audiosource.Stop(); } mmdChange(animRust.runtimeAnimatorController.name, _audiosource.clip, MMD_VMD_Sap.Select_VMD); } else if (playerRust.activeSelf) { MMD_VMD_Rust.enabled = false;
playerEl.SetActive(true); playerEl.transform.localPosition = new Vector3(0, 0, 0); playerEl.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); anim.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(animRust.runtimeAnimatorController.name); anim.runtimeAnimatorController = (RuntimeAnimatorController)animator; //playerSp.SetActive(false); playerRust.SetActive(false);
MMD_VMD.enabled = true; if (Time.timeScale == 1f) { _audiosource.Stop(); _audiosource.Play(); } else if (Time.timeScale == 0f) { _audiosource.Stop(); } mmdChange(anim.runtimeAnimatorController.name, _audiosource.clip, MMD_VMD_Rust.Select_VMD); } } // MMD选择 只需传递Resources路径、音频片段、vmd文件 public void MMD_1_koi() { mmdChange("恋爱循环", sound_koi,VMD_koi); } public void MMD_2_SingMeToSleep() { mmdChange("SingMeToSleep", sound_SingMeToSleep,VMD_SingMeToSleep); } public void MMD_3_Gwiyomi() { mmdChange("Gwiyomi", sound_Gwiyomi, VMD_Gwiyomi); } public void MMD_4_HappyHalloween() { mmdChange("HappyHalloween", sound_HappyHalloween, VMD_HappyHalloween); } public void MMD_5_ldsd() { mmdChange("劣等上等", sound_ldsd, VMD_ldsd); } public void MMD_6_jljt() { mmdChange("极乐净土", sound_jljt, VMD_jljt); } public void MMD_7_PinkCat() { mmdChange("PinkCat", sound_PinkCat, VMD_PinkCat); } public void MMD_8_ELECT() { mmdChange("Elect", sound_ELECT, VMD_ELECT); } public void MMD_9_DreamingChuchu() { mmdChange("DreamingChuchu", sound_DreamingChuchu, VMD_DreamingChuchu); } public void MMD_10_Necomimi() { mmdChange("猫耳开关", sound_Necomimi, VMD_Necomimi); } public void MMD_11_Yumeyume() { mmdChange("Yumeyume", sound_Yumeyume, VMD_Yumeyume); } public void MMD_12_Linngo() { mmdChange("林檎花火とソーダの海", sound_Linngo, VMD_Linngo); } public void MMD_13_lkyb() { mmdChange("恋空予报", sound_lkyb, VMD_lkyb); } public void MMD_14_badbadWater() { mmdChange("我的悲伤是水做的", sound_badbadWater, VMD_badbadWater); } public void MMD_15_ツギハギスタッカート() { mmdChange("ツギハギスタッカート", sound_ツギハギスタッカート, VMD_ツギハギスタッカート); }
// R18MMD public void R18MMD_1_Conqueror() { mmdChange("Conqueror", sound_Conqueror, VMD_Conqueror); } public void R18MMD_2_PacmanGhosts() { mmdChange("PacmanGhosts", sound_PacmanGhosts, VMD_PacmanGhosts); } public void R18MMD_3_FullBodied() { mmdChange("FullBodied", sound_FullBodied, VMD_FullBodied); } public void R18MMD_4_Applepie() { mmdChange("Applepie", sound_Applepie, VMD_Applepie); } public void R18MMD_5_BubbleButt() { mmdChange("BubbleButt", sound_BubbleButt, VMD_BubbleButt); } public void R18MMD_6_SwingDance() { mmdChange("SwingDance", sound_SwingDance, VMD_SwingDance); } public void R18MMD_7_GoodNightKiss() { mmdChange("GoodNightKiss", sound_GoodNightKiss, VMD_GoodNightKiss); } public void R18MMD_8_DojaCat() { mmdChange("DojaCat", sound_DojaCat, VMD_DojaCat); } public void R18MMD_9_DeepBlueTown() { mmdChange("DeepBlueTown", sound_DeepBlueTown, VMD_DeepBlueTown); } public void R18MMD_10_Mister() { mmdChange("Mister", sound_Mister, VMD_Mister); } public void R18MMD_11_Lupin() { mmdChange("Lupin", sound_Lupin, VMD_Lupin); } public void R18MMD_12_HoldDance() { mmdChange("HoldDance", sound_HoldDance, VMD_HoldDance); } public void R18MMD_13_Samsara() { mmdChange("Samsara", sound_Samsara, VMD_Samsara); } public void R18MMD_14_Fireball() { mmdChange("Fireball", sound_Fireball, VMD_Fireball); } public void R18MMD_15_BaamFull() { mmdChange("BaamFull", sound_BaamFull, VMD_BaamFull); } public void R18MMD_16_DestinationCalabria() { mmdChange("DestinationCalabria", sound_DestinationCalabria, VMD_DestinationCalabria); } public void R18MMD_17_Lamb() { mmdChange("Lamb", sound_Lamb, VMD_Lamb); } public void R18MMD_18_ExcuseMe() { mmdChange("ExcuseMe", sound_ExcuseMe, VMD_ExcuseMe); } public void R18MMD_19_KillerB() { mmdChange("KillerB", sound_KillerB, VMD_KillerB); } public void R18MMD_20_PushIt() { mmdChange("PushIt", sound_PushIt, VMD_PushIt); }
// Motions public void Motions_1_motion1() { motionChange("motion1"); if (playerEl.activeSelf) mmdCameraDistance.enabled = false; else if (playerSp.activeSelf) mmdCameraDistanceSap.enabled = false; else if (playerRust.activeSelf) mmdCameraDistanceRust.enabled = false;
CamType2.enabled = true;
Camera.main.transform.localPosition = new Vector3(0, .38f, -.64f); Quaternion rot = Quaternion.Euler(11.51f, 0f, 0f); Camera.main.transform.localRotation = rot; }
private void mmdChange(string strPath, AudioClip a, TextAsset vmdtext) { // 如果MMD_VMD_Rust的distanceOffset改变了,能被检测到,执行两次mmdChange() float tempDistance = MMD_VMD_Rust.distanceOffset; if (playerEl.activeSelf) { for(int i = 0;i<86;i++) { if (i == 62) continue; eyeHeart.SetBlendShapeWeight(i, 0); } tmpText.text = "Now:" + strPath; playerEl.transform.localPosition = new Vector3(0, 0, 0); playerEl.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); if (strPath == "HoldDance") { playerEl.transform.localPosition = new Vector3(0, 0.3f, 0); } anim.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(strPath); anim.runtimeAnimatorController = (RuntimeAnimatorController)animator; _audiosource.Stop(); _audiosource.clip = a; if (Time.timeScale == 1f) { _audiosource.Play(); } MMD_VMD.Select_VMD = vmdtext; MMD_VMD.Start(); if (CamType2.enabled) return; vmdCam.localPosition = new Vector3(0, 0, 0); vmdCam.GetChild(0).localPosition = new Vector3(0, 0, 0); Quaternion rotation = Quaternion.Euler(0f, 0f, 0f); vmdCam.localRotation = rotation; vmdCam.GetChild(0).localRotation = rotation; Camera.main.transform.localPosition = new Vector3(0f, 0f, 0f); Camera.main.transform.localRotation = rotation; if (strPath == "Applepie") { Camera.main.transform.localPosition = new Vector3(.14f, 0, 5.44f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "Conqueror") { Camera.main.transform.localPosition = new Vector3(0f, -0.3076369f, 0f); } else if (strPath == "Gwiyomi") { Camera.main.transform.localPosition = new Vector3(0f, .6f, -1.24f); } else if (strPath == "DeepBlueTown") { Camera.main.transform.localPosition = new Vector3(0f, -.54f, 0f); } else if (strPath == "Mister") { Camera.main.transform.localPosition = new Vector3(0f, -.38f, 0f); } else if (strPath == "Lupin") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 0f); } else if (strPath == "SingMeToSleep") { Camera.main.transform.localPosition = new Vector3(0f, -.3f, 0f); } else if (strPath == "Samsara") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if (strPath == "Fireball") { Camera.main.transform.localPosition = new Vector3(0f, -.05f, 0f); } else if (strPath == "Elect") { Camera.main.transform.localPosition = new Vector3(0f, -.25f, 7.35f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "恋空予报") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if(strPath == "BaamFull") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if(strPath == "DestinationCalabria") { Camera.main.transform.localPosition = new Vector3(0f, -.22f, 0f); } else if (strPath == "Lamb") { Camera.main.transform.localPosition = new Vector3(0f, -.22f, 6.8f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "ExcuseMe") { Camera.main.transform.localPosition = new Vector3(0f, -.15f, 0f); } else if (strPath == "KillerB") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 4f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "我的悲伤是水做的") { Camera.main.transform.localPosition = new Vector3(0f, -.15f, .81f); } else if (strPath == "ツギハギスタッカート") { Camera.main.transform.localPosition = new Vector3(.05f, -.4f, .58f); Invoke("ChangeCam", 8f); } else if (strPath == "DreamingChuchu") { Camera.main.transform.localPosition = new Vector3(0f, -.15f, 0.2f); Invoke("ChangeCam", 9f); } } else if(playerSp.activeSelf) { for (int i = 0; i < 76; i++) { if (i == 67) continue; eyeHeart_sp.SetBlendShapeWeight(i, 0); } tmpText.text = "Now:" + strPath; playerSp.transform.localPosition = new Vector3(0, 0, 0); playerSp.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); if (strPath == "HoldDance") { playerSp.transform.localPosition = new Vector3(0, 0.3f, 0); } animSp.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(strPath); animSp.runtimeAnimatorController = (RuntimeAnimatorController)animator; _audiosource.Stop(); _audiosource.clip = a; if (Time.timeScale == 1f) { _audiosource.Play(); } MMD_VMD_Sap.Select_VMD = vmdtext; MMD_VMD_Sap.Start(); if (CamType2.enabled) return; vmdCam.localPosition = new Vector3(0, 0, 0); vmdCam.GetChild(0).localPosition = new Vector3(0, 0, 0); Quaternion rotation = Quaternion.Euler(0f, 0f, 0f); vmdCam.localRotation = rotation; vmdCam.GetChild(0).localRotation = rotation; Camera.main.transform.localPosition = new Vector3(0f, 0f, 0f); Camera.main.transform.localRotation = rotation; if (strPath == "Applepie") { Camera.main.transform.localPosition = new Vector3(.14f, 0, 5.44f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "Conqueror") { Camera.main.transform.localPosition = new Vector3(0f, -0.1f, 0f); } else if (strPath == "Gwiyomi") { Camera.main.transform.localPosition = new Vector3(0f, .8f, -1.24f); } else if (strPath == "DeepBlueTown") { Camera.main.transform.localPosition = new Vector3(0f, -.54f, 0f); } else if (strPath == "Mister") { Camera.main.transform.localPosition = new Vector3(0f, -.52f, 0f); } else if (strPath == "Lupin") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 0f); } else if (strPath == "SingMeToSleep") { Camera.main.transform.localPosition = new Vector3(0f, -.3f, 0f); } else if (strPath == "Samsara") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if (strPath == "Fireball") { Camera.main.transform.localPosition = new Vector3(0f, -.05f, 0f); } else if(strPath == "FullBodied") { Camera.main.transform.localPosition = new Vector3(0f, .14f, 0f); } else if (strPath == "SwingDance") { Camera.main.transform.localPosition = new Vector3(0f, .15f, 0f); } else if (strPath == "Elect") { Camera.main.transform.localPosition = new Vector3(0f, -.15f, 7.35f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "恋空予报") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if (strPath == "BaamFull") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 0f); } else if (strPath == "DestinationCalabria") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 0f); } else if (strPath == "Lamb") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 6.8f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "KillerB") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 4f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "我的悲伤是水做的") { Camera.main.transform.localPosition = new Vector3(0f, 0f, .81f); } else if (strPath == "ツギハギスタッカート") { Camera.main.transform.localPosition = new Vector3(.05f, -.24f, .55f); } } else if (playerRust.activeSelf) { for (int i = 0; i < 249; i++) { if (i == 173) continue; // heart_eye eyeHeart_sp.SetBlendShapeWeight(i, 0); } tmpText.text = "Now:" + strPath; playerRust.transform.localPosition = new Vector3(0, 0, 0); playerRust.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); if (strPath == "HoldDance") { playerRust.transform.localPosition = new Vector3(0, 0.3f, 0); } animRust.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(strPath); animRust.runtimeAnimatorController = (RuntimeAnimatorController)animator; _audiosource.Stop(); _audiosource.clip = a; if (Time.timeScale == 1f) { _audiosource.Play(); } MMD_VMD_Rust.Select_VMD = vmdtext; MMD_VMD_Rust.Start(); if (CamType2.enabled) return; vmdCam.localPosition = new Vector3(0, 0, 0); vmdCam.GetChild(0).localPosition = new Vector3(0, 0, 0); Quaternion rotation = Quaternion.Euler(0f, 0f, 0f); vmdCam.localRotation = rotation; vmdCam.GetChild(0).localRotation = rotation; Camera.main.transform.localPosition = new Vector3(0f, 0f, 0f); Camera.main.transform.localRotation = rotation; MMD_VMD_Rust.distanceOffset = 1f; if (strPath == "Applepie") { Camera.main.transform.localPosition = new Vector3(.14f, 0, 5.44f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "Conqueror") { Camera.main.transform.localPosition = new Vector3(0f, -0.3076369f, 0f); } else if (strPath == "Gwiyomi") { Camera.main.transform.localPosition = new Vector3(0f, .6f, -1.24f); } else if (strPath == "DeepBlueTown") { Camera.main.transform.localPosition = new Vector3(0f, -.54f, 0f); } else if (strPath == "Mister") { Camera.main.transform.localPosition = new Vector3(0f, -.38f, 0f); } else if (strPath == "Lupin") { Camera.main.transform.localPosition = new Vector3(0f, -.1f, 0f); } else if (strPath == "SingMeToSleep") { Camera.main.transform.localPosition = new Vector3(0f, -.3f, 0f); } else if (strPath == "Samsara") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if (strPath == "Fireball") { Camera.main.transform.localPosition = new Vector3(0f, -.05f, 0f); } else if (strPath == "Elect") { Camera.main.transform.localPosition = new Vector3(0f, -.25f, 7.35f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "恋空予报") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if (strPath == "BaamFull") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 0f); } else if (strPath == "DestinationCalabria") { Camera.main.transform.localPosition = new Vector3(0f, -.22f, 0f); } else if (strPath == "Lamb") { Camera.main.transform.localPosition = new Vector3(0f, -.22f, 6.8f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "ExcuseMe") { Camera.main.transform.localPosition = new Vector3(0f, -.15f, 0f); } else if (strPath == "KillerB") { Camera.main.transform.localPosition = new Vector3(0f, -.2f, 4f); Quaternion rot = Quaternion.Euler(0f, 180f, 0f); Camera.main.transform.localRotation = rot; } else if (strPath == "我的悲伤是水做的") { Camera.main.transform.localPosition = new Vector3(0f, -.15f, .81f); } else if (strPath == "ツギハギスタッカート") { MMD_VMD_Rust.distanceOffset = 2.1f; Camera.main.transform.localPosition = new Vector3(.05f, -.39f, .27f); } } if(playerRust.activeSelf && tempDistance != MMD_VMD_Rust.distanceOffset) { mmdChange(tmpText.text.Substring(4, tmpText.text.Length - 4), _audiosource.clip, MMD_VMD_Rust.Select_VMD); } // Debug.Log(MMD_VMD_Rust.distanceOffset); }
private void motionChange(string strPath) { if (playerEl.activeSelf) { for (int i = 0; i < 86; i++) { if (i == 62) continue; eyeHeart.SetBlendShapeWeight(i, 0); } tmpText.text = "Now:" + strPath; playerEl.transform.localPosition = new Vector3(0, 0, 0); playerEl.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); anim.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(strPath); anim.runtimeAnimatorController = (RuntimeAnimatorController)animator; _audiosource.Stop(); if (CamType2.enabled) return; vmdCam.localPosition = new Vector3(0, 0, 0); vmdCam.GetChild(0).localPosition = new Vector3(0, 0, 0); Quaternion rotation = Quaternion.Euler(0f, 0f, 0f); vmdCam.localRotation = rotation; vmdCam.GetChild(0).localRotation = rotation; Camera.main.transform.localPosition = new Vector3(0f, 0f, 0f); Camera.main.transform.localRotation = rotation; } else if (playerSp.activeSelf) { for (int i = 0; i < 76; i++) { if (i == 67) continue; eyeHeart_sp.SetBlendShapeWeight(i, 0); } tmpText.text = "Now:" + strPath; playerSp.transform.localPosition = new Vector3(0, 0, 0); playerSp.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); animSp.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(strPath); animSp.runtimeAnimatorController = (RuntimeAnimatorController)animator; _audiosource.Stop(); if (CamType2.enabled) return; vmdCam.localPosition = new Vector3(0, 0, 0); vmdCam.GetChild(0).localPosition = new Vector3(0, 0, 0); Quaternion rotation = Quaternion.Euler(0f, 0f, 0f); vmdCam.localRotation = rotation; vmdCam.GetChild(0).localRotation = rotation; Camera.main.transform.localPosition = new Vector3(0f, 0f, 0f); Camera.main.transform.localRotation = rotation; } else if (playerRust.activeSelf) { for (int i = 0; i < 249; i++) { if (i == 173) continue; // heart_eye eyeHeart_sp.SetBlendShapeWeight(i, 0); } tmpText.text = "Now:" + strPath; playerRust.transform.localPosition = new Vector3(0, 0, 0); playerRust.transform.localRotation = Quaternion.Euler(0f, 180f, 0f); animRust.runtimeAnimatorController = null; RuntimeAnimatorController animator = (RuntimeAnimatorController)Resources.Load(strPath); animRust.runtimeAnimatorController = (RuntimeAnimatorController)animator; _audiosource.Stop(); if (CamType2.enabled) return; vmdCam.localPosition = new Vector3(0, 0, 0); vmdCam.GetChild(0).localPosition = new Vector3(0, 0, 0); Quaternion rotation = Quaternion.Euler(0f, 0f, 0f); vmdCam.localRotation = rotation; vmdCam.GetChild(0).localRotation = rotation; Camera.main.transform.localPosition = new Vector3(0f, 0f, 0f); Camera.main.transform.localRotation = rotation; MMD_VMD_Rust.distanceOffset = 1f;
} }
void ChangeCam() { // Camera.main.transform.localPosition = new Vector3(.05f, -.3f, .8f); // kato Camera.main.transform.localPosition = new Vector3(0f, -.5f, 0.2f); // DreamChuChu } }
|