Exemplo n.º 1
0
    /// <summary>
    /// Event handler
    /// </summary>
    /// <param name="eventType"></param>
    /// <param name="Sender"></param>
    /// <param name="Param"></param>
    public void OnEvent(EventType eventType, Component Sender, object Param = null)
    {
        //Detect event type
        switch (eventType)
        {
        case EventType.AIDisplayOpen:
            if (rebootTimer == 0)
            {
                SetAIDisplay();
            }
            break;

        case EventType.AIDisplayPanelOpen:
            OpenAIDisplayPanel();
            break;

        case EventType.AIDisplayClose:
            CloseAIDisplay();
            break;

        case EventType.AISendDisplayData:
            AIDisplayData dataDisplay = Param as AIDisplayData;
            ProcessDisplayData(dataDisplay);
            break;

        case EventType.AISendHackingData:
            AIHackingData dataHacking = Param as AIHackingData;
            ProcessHackingData(dataHacking);
            break;

        default:
            Debug.LogError(string.Format("Invalid eventType {0}{1}", eventType, "\n"));
            break;
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// populates Hacking data (bottom tab in display) with data from AIManager.cs -> UpdateHackingStatus
 /// </summary>
 /// <param name="data"></param>
 private void ProcessHackingData(AIHackingData data)
 {
     if (data != null)
     {
         //bottom tab data
         if (string.IsNullOrEmpty(data.hackingStatus) == false)
         {
             tabBottomText.text = data.hackingStatus;
             tabBottomTextCache = data.hackingStatus;
         }
         else
         {
             tabBottomText.text = "Unknown Data";
         }
         //bottom tab hacking tooltip
         if (string.IsNullOrEmpty(data.tooltipHeader) == false)
         {
             bottomTabTooltip.tooltipHeader = data.tooltipHeader;
         }
         else
         {
             bottomTabTooltip.tooltipHeader = "";
         }
         if (string.IsNullOrEmpty(data.tooltipMain) == false)
         {
             bottomTabTooltip.tooltipMain = data.tooltipMain;
         }
         else
         {
             bottomTabTooltip.tooltipMain = "";
         }
         if (string.IsNullOrEmpty(data.tooltipDetails) == false)
         {
             bottomTabTooltip.tooltipDetails = data.tooltipDetails;
         }
         else
         {
             bottomTabTooltip.tooltipDetails = "";
         }
     }
     else
     {
         Debug.LogWarning("Invalid AIHackingData package (Null)");
     }
 }