コード例 #1
0
       // private GameObject TrackEditPanel;
       // private GameObject TrackBuilderPanel;

  
		void Awake()
		{
            TrackUIHandle.instance = this;

            /*if (this.gameObject.GetComponent<TrackEditUI> () == null)
                trackEditUI = this.gameObject.AddComponent<TrackEditUI> ();
            else
                trackEditUI = this.gameObject.GetComponent<TrackEditUI> ();*/
            
            trackBuilder = this.gameObject.GetComponentInChildren<TrackBuilder>();
            BindingFlags flags = BindingFlags.GetField | BindingFlags.Instance | BindingFlags.NonPublic;
			trackerRiderField = trackBuilder.GetType ().GetField ("trackedRide", flags);
           

            //TrackBuilderPanel = this.transform.FindRecursive ("UpperModules").gameObject;



            //frame=  UIWindowsController.Instance.spawnWindow (UnityEngine.GameObject.Instantiate (Main.AssetBundleManager.UiContainerWindowGo).GetComponent<TrackEditUI>());
            //UIWindowSettings old = this.gameObject.GetComponent<UIWindowSettings> ();


            //UIWindowSettings current =  frame.gameObject.GetComponent<UIWindowSettings> ();
            //current.uniqueTag = old.uniqueTag;
           
        }
コード例 #2
0
        void Start()
        {
            trackUIHandle = this.GetComponent<TrackUIHandle> ();

            LeftTrackButton = this.transform.FindRecursive ("LeftTrack").GetComponent<Button> ();
            RightTrackButton = this.transform.FindRecursive ("RightTrack").GetComponent<Button> ();
            DestroyTrackButton = this.transform.FindRecursive ("DestroyTrack").GetComponent<Button> ();

            TrackBuilderPanel = this.transform.FindRecursive ("UpperModules");
            TrackEditPanel = this.transform.FindRecursive ("TrackEditPanel");

            chainToggle = this.transform.FindRecursive ("ChainBuilderToggle").GetComponent<Toggle> ();

            TrackBuilderToggle = this.transform.FindRecursive ("TrackBuilderToggle").GetComponent<Toggle> ();
            TrackEditToggle = this.transform.FindRecursive ("TrackEditToggle").GetComponent<Toggle> ();


            TrackBuilderToggle.onValueChanged.AddListener((delegate(bool arg0) {
                TrackBuilderPanel.gameObject.SetActive(arg0);
            }));

            TrackEditToggle.onValueChanged.AddListener((delegate(bool arg0) {
                TrackEditPanel.gameObject.SetActive(arg0);
            }));

            LeftTrackButton.onClick.AddListener (new UnityEngine.Events.UnityAction (delegate {
                trackUIHandle.trackBuilder.moveTrackCursorPosition(-1);

            }));

            RightTrackButton.onClick.AddListener (new UnityEngine.Events.UnityAction (delegate {
                trackUIHandle.trackBuilder.moveTrackCursorPosition(1);
            }));

            DestroyTrackButton.onClick.AddListener (new UnityEngine.Events.UnityAction (delegate {
                trackUIHandle.trackBuilder.remove();
                trackUIHandle.trackBuilder.moveTrackCursorPosition(-1);
            }));

            TrackEditPanel.gameObject.SetActive (false);


        }