ひつじを動かそう のバックアップソース(No.4)

#contents
*はじめに [#x7454d9b]

&size(18){[[Unity 初学者のすゝめ]]};の続きです。


#br
[[Unity 初学者のすゝめ]]の続きです。
「初学者」
このページではUnity上でのC#のプログラミングの基本を勉強します。
#br
*ひつじをC#で動かしてみる [#a2e972d3]
#geshi(csharp,number){{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        Vector3 pos = this.transform.position;

        pos.x = 3;
        pos.y = 4;

        this.transform.position = pos;
    }

    // Update is called once per frame
    void Update()
    {    
    }
}
}}

#geshi(csharp,number){{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    { 
        Vector3 pos = this.transform.position;

        pos.x += 0.01f;
        pos.y += 0.01f;

        this.transform.position = pos;
    }
}
}}

#geshi(csharp,number){{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    { 
        Vector3 pos = this.transform.position;

        pos.x += 0.01f;
        pos.y += 0.01f;

        this.transform.position = pos;
    }
}
}}