ENABLE() публичный Метод

public ENABLE ( object args ) : void
args object
Результат void
	void EnableObjects() {
		if (!captureVideo) {
			return;
		}

		foreach (GameObject go in availableObjs) {
			//eventManager.InsertEvent (string.Format("disable({0})",go.name), 0);
			preds.ENABLE(new GameObject[] {go});
		}
	}
Пример #2
0
    void ConsumeData(object sender, EventArgs e)
    {
        if (((RestEventArgs)e).Content is string)
        {
            if ((((RestEventArgs)e).Content.ToString() != string.Empty) &&
                (((RestEventArgs)e).Content.ToString() != lastReceivedData))
            {
                Debug.Log(((RestEventArgs)e).Content);
                CommanderStatus dict = JsonUtility.FromJson <CommanderStatus>(((RestEventArgs)e).Content.ToString());
                if (dict != null)
                {
//					Debug.Log(string.Format("input: \"{0}\", question: \"{1}\", utter: \"{2}\"",dict.input,dict.question,dict.utter));
                    lastReceivedData = ((RestEventArgs)e).Content.ToString();

                    if (dict.input != string.Empty)
                    {
                        ((InputController)(GameObject.Find("IOController").GetComponent("InputController")))
                        .inputString = dict.input.Trim();
                        ((InputController)(GameObject.Find("IOController").GetComponent("InputController")))
                        .MessageReceived(dict.input.Trim());
                    }
                    else if (dict.question != string.Empty)
                    {
                        if (Regex.IsMatch(dict.question, @"The .+ block\?"))
                        {
                            string     color        = dict.question.Split()[1];
                            MethodInfo methodToCall = preds.GetType().GetMethod(color.ToUpper());
                            object     obj          = methodToCall.Invoke(preds, new object[] { world.availableObjs.ToArray() });
                            if (obj != null)
                            {
                                world.ReachFor(GameObject.Find(obj as string));
                            }

                            world.RespondAndUpdate(dict.question);
                        }
                        else if (Regex.IsMatch(dict.question, @".*<.+; .+; .+>\?"))
                        {
                            string coord = Regex.Match(dict.question, @"<.+; .+; .+>").Value;
                            world.RespondAndUpdate(Regex.Replace(dict.question, @"<.+; .+; .+>", "here"));
                            world.ReachFor(GlobalHelper.ParsableToVector(coord));
                        }
                        else
                        {
                            world.RespondAndUpdate(dict.question);
                        }
                    }
                    else if (dict.utter != string.Empty)
                    {
                        world.RespondAndUpdate(dict.utter);
                    }
                    else if (dict.hide != string.Empty)
                    {
                        GameObject obj = GameObject.Find(dict.hide);
                        if (obj != null)
                        {
                            preds.DISABLE(new object[] { obj });
                        }
                    }
                    else if (dict.show != string.Empty)
                    {
                        for (int i = 0; i < objSelector.disabledObjects.Count; i++)
                        {
                            if (objSelector.disabledObjects[i].name == dict.show)
                            {
                                preds.ENABLE(new object[] { objSelector.disabledObjects[i] });
                            }
                        }
                    }
                    else if (dict.anim != string.Empty)
                    {
                        world.MoveToPerform();
                        world.gestureController.PerformGesture(dict.anim);
                    }
                }
            }
        }
    }