【Unity】2048ピース移動の実装(その1)
2019/10/18修正
前回、フラフラになりながら移動処理を考えました(;´・`)> ふぅ
修正が多くて申し訳ないです。
今回は、移動処理を実装して行きたいのですが、
いきなり実装はできないので、準備をしていきます。
ポジション毎のピースのナンバーが必要になるので、
管理用のオブジェクトとスクリプトを用意します。
続いて、GameManagerスクリプトを編集します。
GameManager
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public static int[,] SetNum=new int [4,4]; //ピースNo管理用変数
private bool[,] Flag = new bool[4, 4]; //ポジション毎のピースの有無
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
…