using UnityEngine; using UnityEngine.UI; using System.Collections; using System.Collections.Generic; using System.Linq; public class CharacterPanel : MonoBehaviour { public GameObject character; public Transform weaponsPanel; public Transform actionsPanel; public Transform camerasPanel; public Button buttonPrefab; public Slider motionSpeed; Actions actions; PlayerController controller; Camera[] cameras; void Start () { Initialize (); } void Initialize () { actions = character.GetComponent (); controller = character.GetComponent (); foreach (PlayerController.Arsenal a in controller.arsenal) CreateWeaponButton(a.name); CreateActionButton("Stay"); CreateActionButton("Walk"); CreateActionButton("Run"); CreateActionButton("Sitting"); CreateActionButton("Jump"); CreateActionButton("Aiming"); CreateActionButton("Attack"); CreateActionButton("Damage"); CreateActionButton("Death Reset", "Death"); cameras = GameObject.FindObjectsOfType (); var sort = from s in cameras orderby s.name select s; foreach (Camera c in sort) CreateCameraButton(c); camerasPanel.GetChild (0).GetComponent