Beispiel #1
0
        public void MoveCardBoundaryCheck()
        {
            MoveAction m = new MoveAction();

            m.TargetType = TargetType.Map;
            m.Value      = 5;
            m.Target     = GameObject.Instantiate(new GameObject(), new Vector3(0, 0, 0), Quaternion.identity);
            m.Param      = new Vector3(3f, 0f, 0f);
            c.AddAction(m);

            bool[] success = c.Execute();
            Assert.AreEqual(success[0], true);
        }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray        ray = camera.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                Transform objectHit = hit.transform;
                Debug.Log(objectHit.position);

                //ALREADY EXISITING CARD
                CommonCard c = new CommonCard();

                /*MoveAction m = new MoveAction();
                 * m.TargetType = TargetType.Map;
                 * m.Value = 5;
                 * m.Target = character;
                 * //--------------------
                 *
                 * m.Param = new Vector3(objectHit.position.x, character.transform.position.y, objectHit.position.z);
                 * c.AddAction(m);*/

                //Damage Action testing
                DamageAction d = new DamageAction();
                d.DamageValue = 10;
                d.TargetType  = TargetType.Enemy;
                d.Target      = hit.transform.gameObject;

                c.AddAction(d);

                bool[] success = c.Execute();

                Debug.Log("Clicked");
                // Do something with the object that was hit by the raycast.
            }
        }
    }