長さが2418060文字の文字列があります。 この文字列には、数字、ブラケット、および特殊記号が含まれています。それはそれはとてもすべてのcharが空間的作用を有し、それはだbracet内の数字は変数であるLindermayerSystemだサンプル文字列反復C#モノ
!(242.9288)F(562.7884)/(45)!(242.9288)F(126.8685)&(18.95)F(126.8685)!(140.2591)F(114.399)&
です。
どのようにしてこれを高速に繰り返すことができますか?私はそれが最後の10分のループのために、簡単なことでcharで文字を反復だし、Unityは...もちろん私の内側に、この後に応答していないときはスイッチを持っている:
switch (array[i])
{
//TurnLeft
case '+':
i+=2;
do
{
checkingString.Append(array[i]);
i++;
} while (array[i] != ')');
value=float.Parse(checkingString.ToString());
currentPosRot.rotation = Quaternion.AngleAxis(value, Vector3.left) * currentPosRot.rotation;
//position = position + (rotation * new Vector3(0, 2, 0));
//curve.AddPointAt(position);
checkingString = new StringBuilder();
value = 0.0f;
break;
//Turn right
case '-': ...
なぜdownvotesですか? –