Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     _warningHUD    = GetComponent <Image> ();
     _current_color = _warningHUD.color;
     _mainGame      = GameObject.FindGameObjectWithTag("MainGame").GetComponent <MainGame> ();
     _her           = GameObject.FindGameObjectWithTag("Her");
     _warningMsg    = GameObject.Find("WarningMSG").GetComponent <WarningMsg> ();
 }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        _audioSource  = GetComponent <AudioSource> ();
        _levelManager = GameObject.FindObjectOfType <LevelManager> ();
        _text         = GetComponent <Text> ();
        _mainGame     = GameObject.FindGameObjectWithTag("MainGame").GetComponent <MainGame> ();
        _warningMsg   = GameObject.Find("WarningMSG").GetComponent <WarningMsg> ();

        // will have to show lose screen

        /*
         * _labelWin = GameObject.Find ("Win");
         * if (!_labelWin) {
         *      Debug.LogWarning ("Please create Win obejct");
         * }
         * _labelWin.SetActive (false);
         */
    }
        /// <summary>
        /// called when new notification round -> calls core / adds to db
        /// </summary>
        /// <param name="msg"></param>
        public new static void CallBack(ROSBridgeMsg msg)
        {
            Debug.Log("Warning MSg received");
            WarningMsg warning   = (WarningMsg)msg;
            float      timeframe = warning.GetTimeFrame();

            if (timeframe == 0) // if valid time frame
            {
                return;
            }
            if (Enum.IsDefined(typeof(DummyStates.State), warning.GetCode())) // if valid error code
            {
                Debug.Log("Adding ...");

                Debug.Log("object: " + warning.GetObject());
                Notification note = VRUILogic.Instance.AddNewNotification(DummyStates.MessageType.WARNING, (DummyStates.State)warning.GetCode(),
                                                                          warning.GetObject(), timeframe);
                note.AddAdditionalContent(warning.GetExtra());
            }
        }