Ejemplo n.º 1
0
 public void SetGaugeIcon(string key)
 {
     if (iconLib == null)
     {
         iconLib = (IconLibrary)FindObjectOfType(typeof(IconLibrary));
     }
     gaugeName = key;
     needIcon  = iconLib.GetIcon(gaugeName);
     RefreshGauge();
 }
Ejemplo n.º 2
0
    public void ShowAction(string actionKey)
    {
        _Log("Showing action: " + actionKey);

        bubbleRenderer       = this.GetComponent <SpriteRenderer>();
        bubbleRenderer.color = Color.white;
        actionRenderer       = actionSprite.GetComponent <SpriteRenderer>();
        actionRenderer.color = Color.white;
        if (iconLib == null)
        {
            iconLib = (IconLibrary)FindObjectOfType(typeof(IconLibrary));
        }
        actionRenderer.sprite = iconLib.GetIcon(actionKey);
    }
Ejemplo n.º 3
0
 private Bitmap SelectDefaultIcon(string identifier)
 {
     if (identifier.Contains("usb#vid_046d"))
     {
         return(IconLibrary.GetIcon("logitech"));
     }
     else if (identifier.Contains("usb#vid_045e"))
     {
         return(IconLibrary.GetIcon("microsoft"));
     }
     else if (identifier.Contains("PS3Eye Camera"))
     {
         return(IconLibrary.GetIcon("playstation"));
     }
     else
     {
         return(IconLibrary.GetIcon("webcam"));
     }
 }
Ejemplo n.º 4
0
 public CameraManagerBasler()
 {
     defaultIcon = IconLibrary.GetIcon("basler");
 }
Ejemplo n.º 5
0
 public CameraManagerFrameGenerator()
 {
     defaultIcon = IconLibrary.GetIcon("dashboard");
 }
Ejemplo n.º 6
0
 public CameraManagerIDS()
 {
     defaultIcon = IconLibrary.GetIcon("ids");
 }
Ejemplo n.º 7
0
 public CameraManagerHTTP()
 {
     defaultIcon = IconLibrary.GetIcon("network");
 }
Ejemplo n.º 8
0
 public CameraManagerDaheng()
 {
     defaultIcon = IconLibrary.GetIcon("webcam");
 }
Ejemplo n.º 9
0
    public void ActivatePopup(int actionIndex, List <double> states, List <double> qs)
    {
        trainable = true;
        Sprite targetSprite = GetTileSprite();

        if (actionIndex == 0) // *** Move
        {
            title.text = "Move State";

            List <string> key = new List <string>();
            key.Add("Hunger");
            key.Add("Energy");
            key.Add("Mood");

            List <GaugeAbstract> inputGaugeData = new List <GaugeAbstract>();
            int index = 0;
            foreach (double value in states)
            {
                inputGaugeData.Add(CreatePair(key[index], ((float)states[index] + 0.5f) * 100f));
                index = index + 1;
            }

            key.Clear();

            key.Add("Work");
            key.Add("Eat");
            key.Add("Sleep");

            if (iconLib == null)
            {
                iconLib = (IconLibrary)FindObjectOfType(typeof(IconLibrary));
            }

            List <GaugeAbstract> outputGaugeData = new List <GaugeAbstract>();
            int maxValueIndex = 0;
            index = 0;
            foreach (double value in qs)
            {
                outputGaugeData.Add(CreatePair(key[index], ((float)qs[index]) * 100f));
                if (qs[index] > qs[maxValueIndex])
                {
                    maxValueIndex = index;
                }
                index = index + 1;
            }
            Sprite actionSprite = iconLib.GetIcon(key[maxValueIndex]);
            SetLayout(inputGaugeData, outputGaugeData, targetSprite, actionSprite);
        }
        else if (actionIndex == 1) // *** Action
        {
            title.text = "Action State";

            List <string> key = new List <string>();
            key.Add("Growth");
            key.Add("Water");

            List <GaugeAbstract> inputGaugeData = new List <GaugeAbstract>();
            int index = 0;
            foreach (double value in states)
            {
                inputGaugeData.Add(CreatePair(key[index], ((float)states[index]) * 100f));
                index = index + 1;
            }

            key.Clear();

            key.Add("Idle");
            key.Add("Harvest");
            key.Add("Water");

            if (iconLib == null)
            {
                iconLib = (IconLibrary)FindObjectOfType(typeof(IconLibrary));
            }

            List <GaugeAbstract> outputGaugeData = new List <GaugeAbstract>();
            int maxValueIndex = 0;
            index = 0;
            foreach (double value in qs)
            {
                outputGaugeData.Add(CreatePair(key[index], ((float)qs[index]) * 100f));
                if (qs[index] > qs[maxValueIndex])
                {
                    maxValueIndex = index;
                }
                index = index + 1;
            }
            Sprite actionSprite = iconLib.GetIcon(key[maxValueIndex]);
            SetLayout(inputGaugeData, outputGaugeData, targetSprite, actionSprite);
        }
    }
 public CameraManagerFrameGenerator()
 {
     defaultIcon = IconLibrary.GetIcon("robot");
 }