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;
    }
    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();
    }
 void Start()
 {
     uiControl = FindObjectOfType<UIController>();
     exPanel = uiControl.GetExPanel();
 }
 void Start()
 {
     critterGen = FindObjectOfType<CritterGenerator>();
     textElements = this.gameObject.GetComponentsInChildren<Text>();
     closeButton = okButton.GetComponent<CloseButton>();
     uiControl = FindObjectOfType<UIController>();
     exPanel = uiControl.GetExpandedPanel();
 }
Exemple #6
0
    void Awake()
    {
        exPanel = FindObjectOfType<ExpandedPanel>();
        mainPanel = FindObjectOfType<EvoSubTreePanel>();
        tree = exPanel.evoTree;
        nameHeader = GetComponentInChildren<Text>();

        Deactivate();
    }
 public void ButtonClick()
 {
     exPanel = uicontrol.GetExPanel();
     exPanel.TogglePanel(ExpandedPanel.State.EVOTREE);
 }
Exemple #8
0
 public void SetExpandedPanel(ExpandedPanel newPanel)
 {
     exPanel = newPanel;
 }