コード例 #1
0
        private void Clear()
        {
            int        Height = 1;
            int        Width  = 1;
            BoxScript  ts     = null;
            GameObject go     = null;

            for (int x = 0; x < Width; x++)
            {
                for (int z = 0; z < Height; z++)
                {
                    go = this.gameObject.transform.Find("Tile_" + x.ToString() + "_" + z.ToString()).gameObject;
                    ts = go.GetComponent <BoxScript>();
                    bool cOn = (((x % 2) == 0) && ((z % 2) == 0));
                    ts.ColorChange(false);
                }
            }
        }
コード例 #2
0
        private void Initialize()
        {
            // Create Tiles
            for (int x = 0; x < Width; x++)
            {
                for (int z = 0; z < Height; z++)
                {
                    Vector3    v  = new Vector3(x * Scale, 0, z * Scale);
                    Quaternion q  = new Quaternion(0, 0, 0, 0);
                    GameObject go = GameObject.Instantiate(TileMaster, v, q);
                    go.transform.parent = this.gameObject.transform;
                    go.name             = "Tile_" + x.ToString() + "_" + z.ToString();
                    BoxScript ts  = go.GetComponent <BoxScript>();
                    bool      cOn = (((x % 2) == 0) && ((z % 2) == 0));
                    ts.ColorChange(cOn);
                }
            }

            // Set Camera
            GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

            camera.transform.position = new Vector3(MaxWidth / 2, MaxHeight / 2 * 5, MaxHeight / 2);
        }
コード例 #3
0
ファイル: Line.cs プロジェクト: kris2021/BresenhamLine
 // Use this for initialization
 void Start()
 {
     textManager = FindObjectOfType <TextManager> ();
     boxscript   = FindObjectOfType <BoxScript>();
     gridscript  = FindObjectOfType <GridScript>();
 }
コード例 #4
0
ファイル: TextManager.cs プロジェクト: kris2021/BresenhamLine
 // Use this for initialization
 public void Start()
 {
     gridScript = FindObjectOfType <GridScript> ();
     line       = FindObjectOfType <Line> ();
     boxscript  = FindObjectOfType <BoxScript> ();
 }