Ejemplo n.º 1
0
 void OnCollapseEntry(SteamPunkHierachyEntry entry)
 {
     if (entry.TargetGameObject.transform.parent != null)
     {
         ExpandGameObject(entry.TargetGameObject.transform.parent.gameObject);
     }
     else
     {
         OnOpenHierachy();
     }
 }
Ejemplo n.º 2
0
    void AddEntry(GameObject targetGameObject, bool parent = false)
    {
        // TODO: optimize by recycling the gameobjects for the entries.
        GameObject             entryGO = GameObject.Instantiate(entryPrefab, content.transform);
        SteamPunkHierachyEntry entry   = entryGO.GetComponent <SteamPunkHierachyEntry>();

        entry.SendMessage("SetGameObject", targetGameObject);

        if (parent)
        {
            entry.SendMessage("SetParent");
            entry.onPressExpand += OnCollapseEntry;
        }
        else
        {
            entry.onPressExpand += OnExpandEntry;
        }

        entry.onSelectGameObject += OnSelectGameObject;
    }
Ejemplo n.º 3
0
 void OnExpandEntry(SteamPunkHierachyEntry entry)
 {
     ExpandGameObject(entry.TargetGameObject);
 }