Esempio n. 1
0
        public bool Activate()
        {
            PlayerController.InterpreterLock.Set();

            if (!IsReachable())
            {
                return(false);
            }

            GUITexts guiTexts = GUITexts.GetInstance();

            guiTexts.CollectCoin();

            var mapGenerator = MapGenerator.getInstance();

            var mapBlock = mapGenerator.GetBlockAtLocation(GetBlockPosition());

            mapBlock.DetachGameObject(gameObject);

            GameObject.Destroy(gameObject);

            PerformActions(Map.Config.Action.ACTION_ACTIVATE);

            return(true);
        }
        private void PerformMessageAction()
        {
            if (Message == null || Message.Trim().Equals(""))
            {
                return;
            }

            GUITexts.GetInstance().NewTextMessage(Message);
        }
Esempio n. 3
0
        public bool Activate()
        {
            PlayerController.InterpreterLock.Set();

            if (_isLooted)
            {
                return(false);
            }
            if (!IsReachable())
            {
                return(false);
            }

            GUITexts guiTexts = GUITexts.GetInstance();

            guiTexts.CollectCoin(GetValue());

            ChestClosed.SetActive(false);
            ChestOpened.SetActive(true);

            _isLooted = true;

            return(true);
        }
Esempio n. 4
0
 protected void ShowMessage(string Message, Color TColor)
 {
     SequentialProcedure(() => GUITexts.GetInstance().NewTextMessage(Message, TColor));
 }
Esempio n. 5
0
 protected int GetNumberOfCollectedCoins()
 {
     return(SequentialSensor(() => GUITexts.GetInstance().GetCoinsCount()));
 }
Esempio n. 6
0
 public void SwitchLarge()
 {
     UseLarge = !UseLarge;
     GUITexts.GetInstance().ShowHUDElements = !UseLarge;
 }