コード例 #1
0
        /// <summary>
        /// We select a specific BuildingPlatform as the target
        /// </summary>
        /// <param name="target">The buildingPlatform we are going to select</param>
        public void SetTarget(BuildingPlatform target)
        {
            m_Target = target;

            //We use the building position as the position for the UI
            transform.position = target.GetBuildPosition();

            towerName.text = target.GetTower().name;
            sellPrice.text = target.GetTower().SellPrice + "U";
            UI.SetActive(true);
        }
コード例 #2
0
        /// <summary>
        /// Sells the tower on this platform.
        /// </summary>
        public void SellTower(BuildingPlatform platform)
        {
            //we add the credits that we get from the sale and we destroy the tower
            MinigameManager.Instance.AddCurrency(platform.GetTower().SellPrice);
            ParticleSystem particles = Instantiate <ParticleSystem>(SellEffect, platform.GetBuildPosition(), SellEffect.transform.rotation);

            Destroy(particles, 1.5f);

            //Play the audio sound
            audioSource.clip = sellSound;
            audioSource.Play();

            platform.SellTower();
        }