Exemplo n.º 1
0
 private void SubInitialiseSessionStart()
 {
     //tooltip
     tooltip = sideTabImage.GetComponent <GenericTooltipUI>();
     Debug.Assert(tooltip != null, "Invalid GenericTooltipUI component tooltip (Null)");
     tooltip.isIgnoreClick  = true;
     tooltip.testTag        = "AISideTabUI";
     tooltip.tooltipMain    = "We haven't yet broken the AI's Security systems";
     tooltip.tooltipDetails = "Resistance HQ expect to do so by <b>NEXT TURN</b>";
     //data
     topText.text    = "AI";
     bottomText.text = "-";
     hackingStatus   = HackingStatus.Initialising;
     myCoroutine     = null;
     isFading        = false;
     //set alert flasher to zero opacity
     tempColour         = alertFlasher.color;
     tempColour.a       = 0.0f;
     alertFlasher.color = tempColour;
     //set to Active
     isActive = true;
     //Set all components
     SetAllStatus(isActive);
 }
Exemplo n.º 2
0
 /// <summary>
 /// update data on side tab (sent from AIManager.cs -> UpdateSideTabData) & GenericTooltipUI data
 /// </summary>
 /// <param name="data"></param>
 private void UpdateSideTab(AISideTabData data)
 {
     if (data != null)
     {
         //'A.I'
         if (string.IsNullOrEmpty(data.topText) == false)
         {
             topText.text = data.topText;
         }
         else
         {
             topText.text = "?";
         }
         //cost in Power
         if (string.IsNullOrEmpty(data.bottomText) == false)
         {
             bottomText.text = data.bottomText;
         }
         else
         {
             bottomText.text = "?";
         }
         //hacking Status
         hackingStatus = data.status;
         //alert flasher
         if (hackingStatus == HackingStatus.Possible && sideTabImage.gameObject.activeSelf == true)
         {
             if (myCoroutine == null)
             {
                 myCoroutine = StartCoroutine("ShowAlertFlash");
             }
         }
         else
         {
             if (myCoroutine != null)
             {
                 StopCoroutine(myCoroutine);
                 myCoroutine = null;
                 isFading    = false;
                 //reset opacity back to zero
                 tempColour         = alertFlasher.color;
                 tempColour.a       = 0.0f;
                 alertFlasher.color = tempColour;
             }
         }
         //tooltip data
         if (string.IsNullOrEmpty(data.tooltipMain) == false)
         {
             tooltip.tooltipMain = data.tooltipMain;
             if (string.IsNullOrEmpty(data.tooltipDetails) == false)
             {
                 tooltip.tooltipDetails = data.tooltipDetails;
             }
         }
         else
         {
             tooltip.tooltipMain = "Unknown Data";
         }
     }
     else
     {
         Debug.LogWarning("Invalid AISideTabData (Null)");
     }
 }