//ヒット判定 void OnTriggerStay(Collider other) { if (isBodyHit) { return; } //レイヤーでフィルタかけたほうが安全です { isBodyHit = true; var Player = other.gameObject; if (Player != null) { if (Player.GetComponent <BackClothes>()) { var backClothes = Player.GetComponent <BackClothes>(); Body = backClothes.Body; isVRoid = backClothes.IsVRoid; bodyShoesType = backClothes.IsShoesType; } } } }
void ClothesTypeCheck(Material material) { //靴の場合 if (material.name.IndexOf("_Shoes", StringComparison.Ordinal) >= 0) { if (material.name.IndexOf("_001", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.Loafers; } else if (material.name.IndexOf("_002", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.Onepice; } else if (material.name.IndexOf("_003", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.LoafersPants; } else if (material.name.IndexOf("_004", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.Pumps; } else if (material.name.IndexOf("_005", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.Sneakers; } else if (material.name.IndexOf("_006", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.B_Shoes; } else if (material.name.IndexOf("_007", StringComparison.Ordinal) >= 0) { shoesTex = material.mainTexture; myShoesType = ShoesType.Hi_Cut; } } //Onepice型 if (material.name.IndexOf("_Onepice", StringComparison.Ordinal) >= 0) { //ワンピース型 if (material.name.IndexOf("_01", StringComparison.Ordinal) >= 0) { clothesTex = material.mainTexture; myClothesTyep = ClothesTyep.Onepice; } else if (material.name.IndexOf("_02", StringComparison.Ordinal) >= 0) { clothesTex = material.mainTexture; myClothesTyep = ClothesTyep.Onepicehalf; } else if (material.name.IndexOf("_03", StringComparison.Ordinal) >= 0) { clothesTex = material.mainTexture; myClothesTyep = ClothesTyep.Onepiceshort; } else if (material.name.IndexOf("_04", StringComparison.Ordinal) >= 0) { clothesTex = material.mainTexture; myClothesTyep = ClothesTyep.OnepicePencil; } } else { //上 if (material.name.IndexOf("_Tops", StringComparison.Ordinal) >= 0) { ClothesTypeCheckTop(material); } //下 else if (material.name.IndexOf("_Bottoms", StringComparison.Ordinal) >= 0) { ClothesTypeCheckBottom(material); } } }