Skip to content

Instantly share code, notes, and snippets.

@TheStoneBook
Last active June 30, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheStoneBook/287fdbff4e5c99918182ae3d9d4fa990 to your computer and use it in GitHub Desktop.
Save TheStoneBook/287fdbff4e5c99918182ae3d9d4fa990 to your computer and use it in GitHub Desktop.
【Unity】GUIDを使って配列をシャッフルする。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using System;
public class ShuffleUseGuid : MonoBehaviour {
public GameObject[] Object;
void Update () {
if (Input.GetKeyDown (KeyCode.C))
{
Object = Object.OrderBy (i => Guid.NewGuid ()).ToArray ();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment