private void HandleShowResult(ShowResult result) { switch (result) { case ShowResult.Finished: foreach (GameObject item in items) { if (Random.Range(0, 2) == 0) { personScript.addItem(item); return; } } break; case ShowResult.Skipped: Debug.LogWarning("Video was skipped."); break; case ShowResult.Failed: Debug.LogError("Video failed to show."); break; } }
public void replayRecord(string record) { string[] strings = record.Split(':'); if (strings.Length == 3) { GameObject gobject = (GameObject)Resources.Load(strings[0]); gobject = person.addItem(gobject); if (gobject != null) { Vector2 v2 = new Vector2(float.Parse(strings [1]), float.Parse(strings [2])); gobject.transform.position = v2; } } }