void OnDiscovered()
    {
        _isDiscovered = true;
        _uiItem.transform.Find("text").GetComponent <Text>().text =
            "[" + _entity.name + "]:\n" +
            "??? units of " + FleetVital.Format(_entity.type);

        _uiItem.transform.Find("icon").GetComponent <Image>().sprite = ModelDB.GetResourceIcon(_entity.type);
        _uiItem.transform.Find("icon").GetComponent <Image>().color  = FleetVital.Color(_entity.type);

        LogManager.getInstance.AddEntry("??? units of " + FleetVital.Format(_entity.type) + " has been discovered.");
    }
Exemple #2
0
    void UpdateDetectionAndMovement()
    {
        if (base.prefab == null)
        {
            return;
        }

        UpdateVisualization(
            base.prefab.transform.Find("detectionRange").GetComponent <LineRenderer>(),
            GetVital(FleetVitalType.Detection).current,
            FleetVital.Color(FleetVitalType.Detection),
            _teamID != 0);

        UpdateVisualization(
            base.prefab.transform.Find("movementRange").GetComponent <LineRenderer>(),
            GetVital(FleetVitalType.Movement).max,
            FleetVital.Color(FleetVitalType.Movement),
            true);
    }
    void CreateResourceItem(FleetVitalType type, string tooltip)
    {
        FleetVital v = PlayerData.fleet.GetVital(type);
        GameObject g = Instantiate(_toolbarResourceItem, _toolbar);

        g.GetComponent <GenericTooltipHandler>().Initialize(
            () => TooltipManager.getInstance.OpenTooltip(tooltip + "\n\n" + PlayerData.fleet.GetVital(type).GetTooltipExtended(), Input.mousePosition),
            null,
            null,
            null,
            () => TooltipManager.getInstance.CloseTooltip());

        g.transform.Find("icon").GetComponent <Image>().sprite = ModelDB.GetResourceIcon(type);
        g.transform.Find("icon").GetComponent <Image>().color  = FleetVital.Color(type);

        _resourceItems.Add(g);

        UpdateResourceItem(v);
    }