public override void OnInspectorGUI() { HandHandler myTarget = (HandHandler)target; DrawDefaultInspector(); if (!EditorApplication.isPlaying) { return; } List <InSceneCard> cards = myTarget.getCards(); for (int x = 0; x < myTarget.maxHandSize; x++) { if (x >= cards.Count) { EditorGUILayout.LabelField("Slot " + x, "empty"); } else { EditorGUILayout.LabelField("Slot " + x, cards[x].cardInfo.name); } } if (GUILayout.Button("Update Hands")) { myTarget.UpdateSlots(); } }
public void setupLeapMotion() { leapControl = new Leap.Controller(); HandHandler h = new HandHandler(); leapControl.Connect += h.OnServiceConnect; leapControl.Device += h.OnConnect; leapControl.FrameReady += h.OnFrame; }
private void Awake() { if (_handhandler != null) { Destroy(this); } if (_handhandler == null) { _handhandler = this; } HandList = new List <GameObject>(); _handtransform = HandPanel.GetComponent <Transform>(); _tabletransform = TablePanel.GetComponent <Transform>(); }
// Update is called once per frame void Update() { string temp = ""; int[] roboHandData = new int[4]; for (int i = 0; i < 4; i++) { roboHandData[i] = (int)((UnityEngine.Random.value * 400.0f) + 100); if (i != 3) { temp += roboHandData[i].ToString() + ","; } else { temp += roboHandData[i].ToString(); } } LeftHand = temp; RightHand = temp; Debug.Log(LeftHand); Debug.Log(RightHand); delayTime += Time.deltaTime; if (delayTime >= 0.5f) { try { Debug.Log("Try Update ran "); HandHandler.MoveToPosition_L(LeftHand + "\n"); HandHandler.MoveToPosition_R(RightHand + "\n"); } catch (System.Exception e) { Debug.Log("Stuff sucks " + e); } delayTime = 0.0f; } }
// Use this for initialization void Start() { new HandHandler(); HandHandler.Start(); }
// start is called once at the start of the script private void Start() { cardData = cards.GetComponent <CardData>(); handHandler = cardInHand.GetComponent <HandHandler>(); deckHandler = playerDeck.GetComponent <DeckHandler>(); }