예제 #1
0
    private void UpdateModuleInfo(CModuleInterface _tempModuleInterface)
    {
        // DEBUG: Make a random sentance to describe it
        string desc = CUtility.LoremIpsum(6, 12, 2, 4, 1);

        m_SelectedModuleType     = _tempModuleInterface.ModuleType;
        m_SelectedModuleCategory = _tempModuleInterface.ModuleCategory;
        m_SelectedModuleSize     = _tempModuleInterface.ModuleSize;
        m_SelectedModuleCost     = m_SelectedModuleSize == CModuleInterface.ESize.Small ? 400 : 800;

        // Set the name
        string name = CUtility.SplitCamelCase(m_SelectedModuleType.ToString());

        m_ModuleNameLabel.text = name;

        // Set the category
        m_ModuleCategoryLabel.text = m_SelectedModuleCategory.ToString();

        // Set the size
        UpdateSizeInfo(m_SelectedModuleSize, m_SmallModuleSprite, m_MediumModuleSprite, m_LargeModuleSprite);

        // Set the desc
        m_ModuleDescLabel.text = desc;

        // Set the cost
        m_ModuleCostLabel.text = m_SelectedModuleCost.ToString() + "N";
    }
예제 #2
0
    public List <GameObject> FindModulesByType(CModuleInterface.EType _eModuleType)
    {
        if (!m_mModules.ContainsKey(_eModuleType))
        {
            return(null);
        }

        return(m_mModules[_eModuleType]);
    }
예제 #3
0
    public GameObject CreateModule(CModuleInterface.EType _eType)
    {
        GameObject cModuleObject = null;

        if (!IsModuleAttached)
        {
            cModuleObject = CNetwork.Factory.CreateObject(CModuleInterface.GetPrefabType(_eType));
            cModuleObject.GetComponent <CNetworkView>().SetPosition(m_Positioner.transform.position);
            cModuleObject.GetComponent <CNetworkView>().SetEulerAngles(m_Positioner.transform.rotation.eulerAngles);
            cModuleObject.GetComponent <CNetworkView>().SetParent(GetComponent <CNetworkView>().ViewId);

            m_cAttachedModuleViewId.Set(cModuleObject.GetComponent <CNetworkView>().ViewId);
        }
        return(cModuleObject);
    }
예제 #4
0
	private void UpdateModuleInfo(CModuleInterface _tempModuleInterface)
	{
		// DEBUG: Make a random sentance to describe it
		string desc = CUtility.LoremIpsum(6, 12, 2, 4, 1);

		m_SelectedModuleType = _tempModuleInterface.ModuleType;
		m_SelectedModuleCategory = _tempModuleInterface.ModuleCategory; 
		m_SelectedModuleSize = _tempModuleInterface.ModuleSize;
		m_SelectedModuleCost = m_SelectedModuleSize == CModuleInterface.ESize.Small ? 400 : 800;

		// Set the name
		string name = CUtility.SplitCamelCase(m_SelectedModuleType.ToString());
		m_ModuleNameLabel.text = name;
		
		// Set the category
		m_ModuleCategoryLabel.text = m_SelectedModuleCategory.ToString();
		
		// Set the size
		UpdateSizeInfo(m_SelectedModuleSize, m_SmallModuleSprite, m_MediumModuleSprite, m_LargeModuleSprite);
		
		// Set the desc
		m_ModuleDescLabel.text = desc;
		
		// Set the cost
		m_ModuleCostLabel.text = m_SelectedModuleCost.ToString() + "N";
	}
예제 #5
0
 public void SetSelectedModuleType(CModuleInterface.EType _ModuleType)
 {
     m_CurrentModuleType.Set(_ModuleType);
 }