Ejemplo n.º 1
0
    // Member Properties


    // Member Methods
    public void Start()
    {
        // Get the DUI of the dispenser
        m_DUIDispenser = m_DUIConsole.DUI.GetComponent <CDUIDispenserRoot>();

        // Register the event for building a tool
        m_DUIDispenser.EventBuildToolButtonPressed += HandleDUIButtonPressed;
    }
Ejemplo n.º 2
0
    // Member Properties


    // Member Methods
	public void Start()
    {
		// Get the DUI of the dispenser
		m_DUIDispenser = m_DUIConsole.DUI.GetComponent<CDUIDispenserRoot>();

		// Register the event for building a tool
		m_DUIDispenser.EventBuildToolButtonPressed += HandleDUIButtonPressed;
    }
Ejemplo n.º 3
0
	private void HandleDUIButtonPressed(CDUIDispenserRoot _DUI)
	{
		// Check there is enough nanites for the selected tool
		CShipNaniteSystem sns = CGameShips.Ship.GetComponent<CShipNaniteSystem>();
		if(sns.IsEnoughNanites(_DUI.SelectedToolCost) || m_Debug)
		{
			// Deduct the amount
			if(!m_Debug)
				sns.DeductNanites(_DUI.SelectedToolCost);

			// Spawn the selected tool
			SpawnTool(_DUI.SelectedToolType);
		}
	}
Ejemplo n.º 4
0
    private void HandleDUIButtonPressed(CDUIDispenserRoot _DUI)
    {
        // Check there is enough nanites for the selected tool
        CShipNaniteSystem sns = CGameShips.Ship.GetComponent <CShipNaniteSystem>();

        if (sns.IsEnoughNanites(_DUI.SelectedToolCost) || m_Debug)
        {
            // Deduct the amount
            if (!m_Debug)
            {
                sns.DeductNanites(_DUI.SelectedToolCost);
            }

            // Spawn the selected tool
            SpawnTool(_DUI.SelectedToolType);
        }
    }