我遇到了一个问题而且我不确定如何绕过它。我有5个下拉按钮,当我从第一个下拉列表中选择一个选项时,它会将其更改为所有5个下拉菜单的选项。
非常感谢任何帮助:D(p.s.我只从1个按钮复制了1个代码块。还要注意所有5个下拉列表都是模态的。)
我试图用来更新它的功能是
$(".dropdown-menu li a").click(function() {
$("#Communityone").text($(this).text());
$("#Communityone").val($(this).text());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="Communityone" data-toggle="dropdown">Choice 1 <span class="caret"></span>
</button>
<ul class="dropdown-menu" id="c11">
<div class="col-md-2">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">SpeedRunner</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Giveaway</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Community</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Interactive</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Chill</a>
</li>
<p></p>
</div>
<div class="col-md-2">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">Beta</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">exampl</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">example</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">example</a>
</li>
<p></p>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">example</a>
</li>
<p></p>
</div>
答案 0 :(得分:0)
// save mesh
netMeshSave = net.mesh;
public void ResetNetMesh()
{
UnityEngine.Object.DestroyObject(net.mesh);
net.mesh = (Mesh)Mesh.Instantiate(netMeshSave);
}