x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] C#の基本的な構文をBlueprintに変換してみる

C#を基本言語として開発しているが、

Blueprintでどのように記述していいのかわからない。

基本的な構文から少しずつC#の構文をBlueprintに変換してみる。

int a = 5;   
int b = 6;   
int c = a + b;    

alt text

Product Version: Not Selected
Tags:
more ▼

asked Oct 01 '14 at 05:01 PM in Japanese

avatar image

Gansaibow
26 8 11 14

avatar image Gansaibow Oct 01 '14 at 05:19 PM

int a = 5;

int b = 6;

int c = a + b;

if(c == 11)

{

 print "true";  

}

else

{

 print "false";  

}

alt text

basic_if_else.png (94.2 kB)
avatar image Gansaibow Oct 08 '14 at 03:41 PM

string strArray[] = {“a”, “b”, “c”};

  1. 変数ボタンを押下

  2. 変数名を設定する

  3. 配列ボタンを押下する

  4. 配列の初期値を設定する

alt text

array.png (26.6 kB)
avatar image Gansaibow Oct 08 '14 at 03:54 PM

string strArray[] = {“a”, “b”, “c”};

for(int i = 0; i <= strArray.Length - 1; i++)

{

 printString(strArray[i]);  

}

※ LastIndexも含むので、0~3 の4回Loopが回ってしまう。 3回Loopを回すにはLengthから-1する必要がある。

alt text

forloop.png (50.7 kB)
avatar image Gansaibow Oct 08 '14 at 04:01 PM

string strArray[] = {“a”, “b”, “c”};

foreach(string str in strArray)

{

 printString(str);  

}

alt text

avatar image Gansaibow Oct 09 '14 at 02:10 PM

関数

Private int sum(int a, int b)

  1. 関数ボタンを押下

  2. 関数名を設定する

  3. 入力値を設定する

  4. 出力値を設定する

alt text

private int sum(int a, int b)

{

 int _sum = a + b;  

 return _sum;  

}

void BeginPlay()

{

 int res = sum(1,2);  

 PrintString(res.ToString());  

}

alt text

alt text

function_01_b.png (58.0 kB)
function_02.png (25.9 kB)
function_03.png (56.1 kB)
avatar image Gansaibow Oct 13 '14 at 01:38 PM

Switch文 

Int State = 0;

Switch(State)

{

 case 0:  

    PrintString(State.ToString());  

    break;  

 case 1:  

    PrintString(State.ToString());  

    break;  

 case 2:  

    PrintString(State.ToString());  

    break;  

 default:  

    PrintString(State.ToString());  

    break;  

}

alt text

switch.png (75.7 kB)
avatar image Gansaibow Oct 13 '14 at 01:45 PM

Enum And Switch文

Switch文を使うなら、Enumと組み合わせて使いたい

Enumを宣言する

  1. 右クリック -> ブループリント -> 列挙型

  2. 列挙型名を宣言する

  3. 列挙型を定義する

alt text

Enum GameState

{

 Start,  

 Stop,  

 End  

}

GameState state = GameState.Start;

Switch(state)

{

 GameState.Start:  

     PrintString(state.ToString());  

     break;  

 GameState.Stop:  

     PrintString(state.ToString());  

     break;  

 GameState.End:  

     PrintString(state.ToString());  

     break;  

}

alt text

enum.png (129.8 kB)
switchandenum.png (46.4 kB)
(comments are locked)
10|2000 characters needed characters left

The question has been closed Oct 14 '17 at 02:51 PM by Ken.Kuwano for the following reason:

質問や不具合報告ではなく情報共有としての投稿のため


1 answer: sort voted first

情報を共有頂きありがとうございます。
こちらの投稿は質問や不具合報告ではないため解決済みとしてクローズさせていただきます。
よろしくおねがいします。

more ▼

answered Oct 14 '17 at 02:50 PM

avatar image

Ken.Kuwano STAFF
380 3 3 5

(comments are locked)
10|2000 characters needed characters left

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question