Last active
June 30, 2018 13:51
-
-
Save TheStoneBook/287fdbff4e5c99918182ae3d9d4fa990 to your computer and use it in GitHub Desktop.
【Unity】GUIDを使って配列をシャッフルする。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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