Example #1
0
        public void MoveWtihTouch(object o, TouchCotroller.TouchResult result)
        {
            if (result != null)
            {
                if (result.hitInfo.collider == null || result.hitInfo.collider.gameObject.layer != 9)
                {
                    return;
                }
                var targetPos = result.hitInfo.point;

                var direction = targetPos - this.transform.position;
                Move(targetPos, direction, AllSpeed);
            }
            else
            {
                Debug.Log("[EndllessChallenger]touch result is null");
            }
        }
Example #2
0
        public void SetEffectPoseWithTouch(object o, TouchCotroller.TouchResult result)
        {
            if (result != null)
            {
                if (result.hitInfo.collider == null)
                {
                    return;
                }
                Vector3 targetPos = Vector3.zero;
                if (result.hitInfo.collider.gameObject.layer == 9)
                {
                    targetPos = result.hitInfo.point;
                }
                else if (result.hitInfo.collider.gameObject.layer == 10)
                {
                    targetPos = result.hitInfo.transform.position;
                }

                MoveCurEffect.Play();
                MoveCurEffect.transform.position = targetPos + new Vector3(0, 0.1f, 0);
            }
        }