Exemplo n.º 1
0
    // Sets up a trigger between TinkerTexts and SceneObjects.
    private void loadTrigger(Trigger trigger)
    {
        switch (trigger.type)
        {
        case TriggerType.CLICK_TINKERTEXT_SCENE_OBJECT:
            // It's possible this sceneObject was not added because we found that it
            // overlapped with a previous object. This is fine, just skip it.
            if (!this.sceneObjects.ContainsKey(trigger.args.sceneObjectId))
            {
                return;
            }
            SceneObjectManipulator manip =
                this.sceneObjects[trigger.args.sceneObjectId]
                .GetComponent <SceneObjectManipulator>();
            TinkerText tinkerText = this.tinkerTexts[trigger.args.textId]
                                    .GetComponent <TinkerText>();
            Action action = manip.Highlight(Constants.SCENE_OBJECT_HIGHLIGHT_COLOR);
            tinkerText.AddClickHandler(action);
            manip.AddClickHandler(tinkerText.Highlight());
            break;

        default:
            Logger.LogError("Unknown TriggerType: " + trigger.type);
            break;
        }
    }
    // Sets up a trigger between TinkerTexts and SceneObjects.
    private void loadTrigger(Trigger trigger)
    {
        switch (trigger.type)
        {
        case TriggerType.CLICK_TINKERTEXT_SCENE_OBJECT:
            SceneObjectManipulator manip =
                this.sceneObjects[trigger.args.sceneObjectId]
                .GetComponent <SceneObjectManipulator>();
            TinkerText tinkerText = this.tinkerTexts[trigger.args.textId]
                                    .GetComponent <TinkerText>();
            Action action = manip.Highlight(new Color(0, 1, 1, 60f / 255));
            tinkerText.AddClickHandler(action);
            break;

        default:
            Logger.LogError("Unknown TriggerType: " +
                            trigger.type.ToString());
            break;
        }
    }