Ejemplo n.º 1
0
        protected override Tween DOPlay()
        {
            if (null == m_Transform)
            {
                return(null);
            }
            // end if
            switch (m_MoveType)
            {
            case MoveTypeEnum.Move:
                return(m_Transform.DOMove(m_toPosition, m_duration, m_isSnapping));

            case MoveTypeEnum.MoveX:
                return(m_Transform.DOMoveX(m_toMoveX, m_duration, m_isSnapping));

            case MoveTypeEnum.MoveY:
                return(m_Transform.DOMoveY(m_toMoveY, m_duration, m_isSnapping));

            case MoveTypeEnum.MoveZ:
                return(m_Transform.DOMoveZ(m_toMoveZ, m_duration, m_isSnapping));

            default: return(null);
            } // end switch
        }
Ejemplo n.º 2
0
        public static void RepulseToRightRandomly(Transform transform, float minDistance, float maxDistance, float overTime)
        {
            float distance = UnityEngine.Random.Range(minDistance, maxDistance);

            transform.DOMove(new Vector3(transform.position.x + distance, transform.position.y, transform.position.z), overTime, false);
        }
Ejemplo n.º 3
0
 public static void RepulseToRight(Transform transform, float xDistance, float overTime)
 {
     transform.DOMove(new Vector3(transform.position.x + xDistance, transform.position.y, transform.position.z), overTime, false);
 }
Ejemplo n.º 4
0
        public static void RepulseToLeftRandomly(Transform transform, float minDistance, float maxDistance, float overTime)
        {
            float distance = Rand.Range(minDistance, maxDistance);

            transform.DOMove(new Vector3(transform.position.x - distance, transform.position.y, transform.position.z), overTime, false);
        }