//public string[] Sentence;

    new void Start()
    {
        mcRef = GameObject.Find("MasterController").GetComponent <MasterControllerScript> ();
        ds    = mcRef.getStorage();
        state = WellState.WaitingForVignette;
        isWaitingForActionToComplete = true;
        rosetta = GameObject.Find("Rosetta").GetComponent <Rosetta> ();

        if (ds.retrieveBoolValue(wellID))
        {
            closeWell();
        }

        levelRef = GameObject.Find("LevelController").GetComponent <LevelControllerScript> ();
    }
        /// <summary>
        /// Creates a new well.
        /// </summary>
        private void CreateWell(SystemContext context, BaseObjectState area, string wellId, string wellName)
        {
            WellState well = new WellState(null);

            well.NodeId           = new NodeId(wellId, NamespaceIndex);
            well.BrowseName       = new QualifiedName(wellName, NamespaceIndex);
            well.DisplayName      = wellName;
            well.EventNotifier    = EventNotifiers.SubscribeToEvents | EventNotifiers.HistoryRead | EventNotifiers.HistoryWrite;
            well.TypeDefinitionId = new NodeId(ObjectTypes.WellType, NamespaceIndex);

            area.AddNotifier(SystemContext, Opc.Ua.ReferenceTypeIds.HasNotifier, false, well);
            well.AddNotifier(SystemContext, Opc.Ua.ReferenceTypeIds.HasNotifier, true, area);

            AddPredefinedNode(SystemContext, well);
        }
Exemple #3
0
    void SetState(WellState state)
    {
        switch (state)
        {
        case WellState.Inactive:
            activeSprite.Visible   = false;
            inactiveSprite.Visible = true;
            break;

        case WellState.Active:
            activeSprite.Visible   = true;
            inactiveSprite.Visible = false;
            break;
        }

        this.state = state;
    }
        internal void OnMouseMove(Point pt)
        {
            if (IsCtrlPressed())
            {
                //SetAll2Default();
                return;
            }
            int focusID = GetFocusID(pt);

            foreach (MyDrawingVisual drawingVisual in _allWellVisuals)
            {
                if (drawingVisual.State == WellState.Selected) //don't change the selected one.
                {
                    continue;
                }
                WellState state = drawingVisual.ID == focusID ? WellState.HighLight : WellState.Normal;
                drawingVisual.State = state;
            }
        }
        private Color GetStateColor(WellState state)
        {
            Color color;

            switch (state)
            {
            case WellState.HighLight:
                color = Colors.Yellow;
                break;

            case WellState.Selected:
                color = Colors.LightGreen;
                break;

            default:
                color = Colors.White;
                break;
            }
            return(color);
        }
    new void Update()
    {
        switch (state)
        {
        case WellState.WaitingForVignette:
            if (!isWaitingForActionToComplete)
            {
                state = WellState.ReadyToChangeLocation;
            }
            break;

        case WellState.ReadyToChangeLocation:
            string     loc    = levelRef.locationName;
            GameObject player = GameObject.Find("Player");
            ds.storeFloatValue("Coords" + loc + "X", player.transform.position.x);
            ds.storeFloatValue("Coords" + loc + "Y", player.transform.position.y);
            ds.storeFloatValue("Coords" + loc + "Z", player.transform.position.z);
            ds.storeIntValue("Orientation" + loc, player.GetComponent <PlayerScript> ().orientation());
            ds.storeIntValue("BlueManaObtained", blueMana);
            ds.storeIntValue("RedManaObtained", redMana);
            int blue = ds.retrieveIntValue("BlueMana");
            blue += blueMana;
            ds.storeIntValue("BlueMana", blue);
            int red = ds.retrieveIntValue("RedMana");
            red += redMana;
            ds.storeIntValue("RedMana", red);
//			mcRef.selectMixer (0);
//			mcRef.setVolume (0.0f, 5);
//			mcRef.selectMixer (2);
//			mcRef.playMusic (2);
//			mcRef.setVolume (1.0f, 5);
            SceneManager.LoadScene("Scenes/SentenceOrdering");
            state = WellState.Finished;
            break;

        default:
            break;
        }
    }
        /// <summary>
        /// Creates a new well.
        /// </summary>
        private void CreateWell(SystemContext context, BaseObjectState area, string wellId, string wellName)
        {
            WellState well = new WellState(null);

            well.NodeId = new NodeId(wellId, NamespaceIndex);
            well.BrowseName = new QualifiedName(wellName, NamespaceIndex);
            well.DisplayName = wellName;
            well.EventNotifier = EventNotifiers.SubscribeToEvents | EventNotifiers.HistoryRead | EventNotifiers.HistoryWrite;
            well.TypeDefinitionId = new NodeId(ObjectTypes.WellType, NamespaceIndex);

            area.AddNotifier(SystemContext, Opc.Ua.ReferenceTypeIds.HasNotifier, false, well);
            well.AddNotifier(SystemContext, Opc.Ua.ReferenceTypeIds.HasNotifier, true, area);

            AddPredefinedNode(SystemContext, well);
        }