Esempio n. 1
0
    /// <summary>
    ///     Shows the TargetText (SendMessageUpwards)
    /// </summary>
    /// <param name="data">The data.</param>
    internal void ShowTargetText(StorageStruct data)
    {
        _gameState = GUIStates.Score;

        _targetText = (GameObject)Instantiate(TargetText);
        _targetText.transform.parent = transform;
        _targetText.GetComponent <TextMesh>().text = data.Hits + " Schläge";

        _ballToDestroy = data.Ball;
    }
Esempio n. 2
0
    /// <summary>
    ///     Ball hits the target.
    /// </summary>
    /// <param name="hits">The number of hits.</param>
    public void BallInHole(int hits)
    {
        AutoZoom(true);
        _active = false;

        AudioSource.PlayClipAtPoint(TargetClip, _golfBall.transform.position);

        // send information to GUI
        var tempStorage = new StorageStruct
        {
            Hits = hits,
            Ball = _golfBall
        };

        SendMessageUpwards("ShowTargetText", tempStorage);
    }
Esempio n. 3
0
        private void RefreshStorage()
        {
            int    i;
            string id, name, amount, minAmount, sectionId, agentId, price;

            OKDT.Storage[]  readStorages;
            StorageStruct[] storageChilds;

            StorageStruct Header = new StorageStruct("Id", "Имя продукта", "Объем", "Минимальный объем", "Id отдела", "Id поставщика", "Стоимость");

            StructureViewStack.Children.Clear();
            readStorages        = OKDT.StructWorkClass.ReadFullStorage();
            storageChilds       = new StorageStruct[readStorages.Length];
            AddRow.Height       = new GridLength(50);
            addStatus           = 1;
            HeaderFrame.Content = Header;

            addName      = "Product name";
            addAmount    = 0;
            addMinAmount = 0;
            addSectionId = 0;
            addAgentId   = 0;
            addPrice     = 0;

            writeStorage     = new AddStorageElement();
            AddFrame.Content = writeStorage;

            for (i = 0; i < readStorages.Length; i++)
            {
                id        = Convert.ToString(readStorages[i].Id);
                name      = readStorages[i].Name;
                amount    = Convert.ToString(readStorages[i].Amount);
                minAmount = Convert.ToString(readStorages[i].MinAmount);
                sectionId = Convert.ToString(readStorages[i].SectionId);
                agentId   = Convert.ToString(readStorages[i].AgentId);
                price     = Convert.ToString(readStorages[i].Price);

                storageChilds[i] = new StorageStruct(id, name, amount, minAmount, sectionId, agentId, price);
                StructureViewStack.Children.Add(storageChilds[i]);
            }
        }