Skip to content

Instantly share code, notes, and snippets.

View flushpot1125's full-sized avatar

Limes2018 flushpot1125

View GitHub Profile
@flushpot1125
flushpot1125 / ButtonClickSimulator.cs
Created June 11, 2016 00:44
Emulation for clicking button of uGUI
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 June 11, 2016 00:49
Clicking button emulation at 4 sec interval
using System;
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
namespace StructureAR
{
public class AutoScanController : MonoBehaviour {
@flushpot1125
flushpot1125 / Buttons.cs(Part of)
Created June 11, 2016 00:58
Part of Buttons.cs provided by Occipital Team
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
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>();
<?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>
case ActivationKind.VoiceCommand:
var commandArgs = args as VoiceCommandActivatedEventArgs;
SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;
string voiceCommandName = speechRecognitionResult.RulePath[0];
switch (voiceCommandName)
{
case "startPlay":
{
break;
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");
using UnityEngine;
using System.Collections;
public class InvokedByCortana : MonoBehaviour {
public delegate void OnEvent(object arg);
public OnEvent onEvent = null;
public GameObject flarePrefab;
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;
using UnityEngine;
using Chronos;
public class BaseBehaviour : MonoBehaviour
{
public Timeline time
{
get
{
return GetComponent<Timeline>();