Skip to content

Instantly share code, notes, and snippets.

Avatar

Limes2018 flushpot1125

View GitHub Profile
@flushpot1125
flushpot1125 / ButtonClickSimulator.cs
Created Jun 11, 2016
Emulation for clicking button of uGUI
View ButtonClickSimulator.cs
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ButtonClickSimulator : MonoBehaviour {
[SerializeField] Button button;
// Use this for initialization
void Start () {
@flushpot1125
flushpot1125 / AutoScanController.cs
Created Jun 11, 2016
Clicking button emulation at 4 sec interval
View AutoScanController.cs
using System;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
namespace StructureAR
{
public class AutoScanController : MonoBehaviour {
@flushpot1125
flushpot1125 / Buttons.cs(Part of)
Created Jun 11, 2016
Part of Buttons.cs provided by Occipital Team
View Buttons.cs(Part of)
protected IEnumerator AssignGameEvent()
{
while (Manager._structureManager==null)
{
yield return new WaitForEndOfFrame();
}
//the manager has arrived, wait for instructions.
this.ButtonClickedEvent += Manager._structureManager.HandleButtonClickedEvent;
//set initial state on startup
View CortanaController.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class CortanaController : MonoBehaviour {
public GameObject botUIPanel;
public List<string> questions = new List<string>();
public List<string> answers = new List<string>();
View VCD.xml
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
<CommandSet xml:lang="en-us" Name="CommandSet_en-us">
<AppName> Bot World </AppName>
<Example> Bot World, I want to play </Example>
<Command Name="checkScore">
<Example> Bot World, Did anyone beat me? </Example>
<ListenFor RequireAppName="BeforeOrAfterPhrase"> Did anyone beat me </ListenFor>
<Feedback> Yes.</Feedback>
View 1_App.xaml.cs
case ActivationKind.VoiceCommand:
var commandArgs = args as VoiceCommandActivatedEventArgs;
SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;
string voiceCommandName = speechRecognitionResult.RulePath[0];
switch (voiceCommandName)
{
case "startPlay":
{
break;
View 2_App.xaml.cs
try
{
var storageFile =
await Windows.Storage.StorageFile
.GetFileFromApplicationUriAsync(new Uri("ms-appx:///vcd.xml"));
await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager
.InstallCommandDefinitionsFromStorageFileAsync(storageFile);
Debug.WriteLine("VCD installed");
View InvokedByCortana.cs
using UnityEngine;
using System.Collections;
public class InvokedByCortana : MonoBehaviour {
public delegate void OnEvent(object arg);
public OnEvent onEvent = null;
public GameObject flarePrefab;
View VoiceSpeech.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Threading.Tasks;
using Windows.Media.SpeechRecognition;
using Windows.Media.SpeechSynthesis;
using Windows.UI.Core;
using Windows.UI.Xaml;
View BaseBehaviour.cs
using UnityEngine;
using Chronos;
public class BaseBehaviour : MonoBehaviour
{
public Timeline time
{
get
{
return GetComponent<Timeline>();
You can’t perform that action at this time.