Exemplo n.º 1
0
    void Awake()
    {
        uicontrol = FindObjectOfType<UIController>();
        exPanel = uicontrol.GetExPanel();
        image = GetComponent<Image>();
        icon = image.GetComponentsInChildren<Image>()[1];
        anim = GetComponent<Animator>();

        defaultImage = icon.sprite;
        defaultColor = image.color;
    }
Exemplo n.º 2
0
    void Update()
    {
        if(Input.GetMouseButtonUp(0)){
            buttonHit = UIController.GetButtonHit();

            if (buttonHit)
            {
                exPanel = uiControl.GetExPanel();

                if (buttonHit.tag == "Temporary")
                {
                    //prevents opening/altering the expaneded panel if there isn't a creature.
                }

                else if (buttonHit == this.gameObject)
                {
                    uiControl.SetSelectedCritter(target);

                    if (!exPanel.isActiveAndEnabled)
                        {
                            exPanel.Activate(ExpandedPanel.State.CRITTERDETAILS);
                        }

                    else if (activeButton == this.gameObject)
                    {
                        exPanel.TogglePanel(ExpandedPanel.State.CRITTERDETAILS);
                        uiControl.SetSelectedCritter(target);

                        if (exPanel.isActiveAndEnabled)
                        {
                            activeButton = null;
                        }
                    }

                    activeButton = this.gameObject;
                }
            }
            else{
                buttonHit = null;
            }
        }
    }
    void Start()
    {
        uiControl = FindObjectOfType<UIController>();
        exPanel = uiControl.GetExpandedPanel();
        button = GetComponent<Button>();

        UpdateButton();
    }
Exemplo n.º 4
0
 void Start()
 {
     uiControl = FindObjectOfType<UIController>();
     exPanel = uiControl.GetExPanel();
 }
Exemplo n.º 5
0
 void Start()
 {
     critterGen = FindObjectOfType<CritterGenerator>();
     textElements = this.gameObject.GetComponentsInChildren<Text>();
     closeButton = okButton.GetComponent<CloseButton>();
     uiControl = FindObjectOfType<UIController>();
     exPanel = uiControl.GetExpandedPanel();
 }
Exemplo n.º 6
0
    void Awake()
    {
        exPanel = FindObjectOfType<ExpandedPanel>();
        mainPanel = FindObjectOfType<EvoSubTreePanel>();
        tree = exPanel.evoTree;
        nameHeader = GetComponentInChildren<Text>();

        Deactivate();
    }
Exemplo n.º 7
0
 public void ButtonClick()
 {
     exPanel = uicontrol.GetExPanel();
     exPanel.TogglePanel(ExpandedPanel.State.EVOTREE);
 }
Exemplo n.º 8
0
 public void SetExpandedPanel(ExpandedPanel newPanel)
 {
     exPanel = newPanel;
 }