Beispiel #1
0
        /// <summary>
        /// Deletes a variable and all of its uses from this workspace without asking the
        /// user for confirmation.
        /// </summary>
        /// <param name="variable"> Variable to delete</param>
        public void DeleteVariableInternal(VariableModel variable)
        {
            var uses = GetVariableUses(variable.Name);

            foreach (var block in uses)
            {
                block.Dispose(true);
            }
            VariableMap.DeleteVariable(variable);
        }
Beispiel #2
0
        /// <summary>
        /// Deletes a variable and all of its uses from this workspace without asking the
        /// user for confirmation.
        /// </summary>
        /// <param name="variable"> Variable to delete</param>
        public void DeleteVariableInternal(VariableModel variable)
        {
            var uses = GetVariableUses(variable.Name);

            foreach (var block in uses)
            {
                TrackerAsset.Instance.setVar("block_type", block.Type);
                TrackerAsset.Instance.setVar("action", "remove");
                TrackerAsset.Instance.GameObject.Interacted(GameManager.Instance.GetBlockId(block));

                block.Dispose(true);
            }
            VariableMap.DeleteVariable(variable);
        }