Exemplo n.º 1
0
    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();
        }
    }
Exemplo n.º 2
0
    public void setupLeapMotion()
    {
        leapControl = new Leap.Controller();
        HandHandler h = new HandHandler();

        leapControl.Connect    += h.OnServiceConnect;
        leapControl.Device     += h.OnConnect;
        leapControl.FrameReady += h.OnFrame;
    }
Exemplo n.º 3
0
    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>();
    }
Exemplo n.º 4
0
    // 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;
        }
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     new HandHandler();
     HandHandler.Start();
 }
Exemplo n.º 6
0
 // 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>();
 }