Ejemplo n.º 1
0
    /**
     * @fn  public void TimeScaleEase(EaseType type, float start, float end, float duration)
     * @author 김경호([email protected])
     * @brief	TimeScale을 Tween한다.
     */
    public void TimeScaleEase(EaseType type, float start, float end, float duration)
    {
        TweenInformation info = new TweenInformation();

        info.SetTweenValue(type, TweenType.TimeScale, null, duration, 0.0f, false, null, new Vector2(start, end));

        _tweenObjectList.Add(info);
    }
Ejemplo n.º 2
0
    public void PositionXYZEaseDelay(GameObject targetObject, EaseType type, TweenType tweentype, float start, float end, float delay, float duration, bool isLocal = false, EventHandler hdr = null)
    {
        TweenInformation info = new TweenInformation();

        info.SetTweenValue(type, tweentype, targetObject, duration, delay, isLocal, hdr, new Vector2(start, end));

        _tweenObjectList.Add(info);
    }
Ejemplo n.º 3
0
    public void FogEase(EaseType type, Color start, Color end, float duration)
    {
        TweenInformation info = new TweenInformation();

        info.SetTweenValue(type, TweenType.Fog, null, duration, 0.0f, false, null, new Vector2(start.r, end.r), new Vector3(start.g, end.g), new Vector2(start.b, end.b));

        _tweenObjectList.Add(info);
    }
Ejemplo n.º 4
0
    /**
     * @fn  public void ScaleEase(GameObject targetObject, EaseType type, Vector3 start, Vector3 end, float duration, EventHandler hdr = null)
     * @author 김경호([email protected])
     * @brief	GameObject Scale을 트윈한다.
     * @param	targetObject tween할 GameObject
     * @param	type	Tween에 사용할 Ease Type
     * @param	start	시작크기
     * @param   end 목표크기
     * @param	duration Tween의 지속시간
     * @param	hdr	Tween이 끝난 후 호출될 Event함수
     */
    public void ScaleEase(GameObject targetObject, EaseType type, Vector3 start, Vector3 end, float duration, EventHandler hdr = null)
    {
        TweenInformation info = new TweenInformation();

        info.SetTweenValue(type, TweenType.Scale, targetObject, duration, 0.0f, true, hdr, new Vector2(start.x, end.x), new Vector2(start.y, end.y), new Vector2(start.z, end.z));

        _tweenObjectList.Add(info);
    }
Ejemplo n.º 5
0
    /**
     * @fn  public void PositionEase(GameObject targetObject, EaseType type, Vector3 start, Vector3 end, float duration, bool isLocal = false, EventHandler hdr = null)
     * @author 김경호([email protected])
     * @brief	GameObject position을 트윈한다.
     * @param	targetObject tween할 GameObject
     * @param	type	Tween에 사용할 Ease Type
     * @param	start	시작점
     * @param   end 도착점
     * @param	duration Tween의 지속시간
     * @param	isLocal	위치 이동의 공간이 로컬인지 월드인지 셋팅
     * @param	hdr	이동이 끝난 후 호출될 Event함수
     */
    public void PositionEase(GameObject targetObject, EaseType type, Vector3 start, Vector3 end, float duration, bool isLocal = false, EventHandler hdr = null, object obj = null)
    {
        TweenInformation info = new TweenInformation();

        info.SetTweenValue(type, TweenType.Position, targetObject, duration, 0.0f, isLocal, hdr, obj, new Vector2(start.x, end.x), new Vector2(start.y, end.y), new Vector2(start.z, end.z));

        _tweenObjectList.Add(info);
    }
Ejemplo n.º 6
0
    /**
     * @fn  public void RotationEase(GameObject targetObject, EaseType type, Quaternion start, Quaternion end, float duration, bool isLocal = false, EventHandler hdr = null)
     * @author 김경호([email protected])
     * @brief	GameObject 회전을 트윈한다.
     * @param	targetObject tween할 GameObject
     * @param	type	Tween에 사용할 Ease Type
     * @param	start	시작 Quaternion
     * @param   end 목표 Quaternion
     * @param	duration Tween의 지속시간
     * @param	hdr	Tween 이 끝난 후 호출될 Event함수
     */
    public void RotationEase(GameObject targetObject, EaseType type, Quaternion start, Quaternion end, float duration, bool isLocal = false, EventHandler hdr = null)
    {
        TweenInformation info = new TweenInformation();

        float tempEndX;
        float tempEndY;
        float tempEndZ;

        if (start.eulerAngles.x > end.eulerAngles.x)
        {
            tempEndX = end.eulerAngles.x + 360.0f;
        }
        else
        {
            tempEndX = end.eulerAngles.x - 360.0f;
        }

        if (Mathf.Abs(start.eulerAngles.x - end.eulerAngles.x) < Mathf.Abs(start.eulerAngles.x - tempEndX))
        {
            tempEndX = end.eulerAngles.x;
        }

        if (start.eulerAngles.y > end.eulerAngles.y)
        {
            tempEndY = end.eulerAngles.y + 360.0f;
        }
        else
        {
            tempEndY = end.eulerAngles.y - 360.0f;
        }

        if (Mathf.Abs(start.eulerAngles.y - end.eulerAngles.y) < Mathf.Abs(start.eulerAngles.y - tempEndY))
        {
            tempEndY = end.eulerAngles.y;
        }

        if (start.eulerAngles.z > end.eulerAngles.z)
        {
            tempEndZ = end.eulerAngles.z + 360.0f;
        }
        else
        {
            tempEndZ = end.eulerAngles.z - 360.0f;
        }

        if (Mathf.Abs(start.eulerAngles.z - end.eulerAngles.z) < Mathf.Abs(start.eulerAngles.z - tempEndZ))
        {
            tempEndZ = end.eulerAngles.z;
        }

        //Debug.Log(tempEndY);

        info.SetTweenValue(type, TweenType.Rotation, targetObject, duration, 0.0f, isLocal, hdr, new Vector2(start.eulerAngles.x, tempEndX),
                           new Vector2(start.eulerAngles.y, tempEndY), new Vector2(start.eulerAngles.z, tempEndZ));

        _tweenObjectList.Add(info);
    }
Ejemplo n.º 7
0
    public void PositionEaseDelay(GameObject targetObject, EaseType type, Vector3 end, float duration, float delay, bool isLocal = false, EventHandler hdr = null)
    {
        if (isLocal == true)
        {
            TweenInformation info = new TweenInformation();

            info.SetTweenValue(type, TweenType.Position, targetObject, duration, delay, isLocal, hdr, new Vector2(targetObject.transform.localPosition.x, end.x),
                               new Vector2(targetObject.transform.localPosition.y, end.y), new Vector2(targetObject.transform.localPosition.z, end.z));

            _tweenObjectList.Add(info);
        }
        else
        {
            TweenInformation info = new TweenInformation();

            info.SetTweenValue(type, TweenType.Position, targetObject, duration, delay, isLocal, hdr, new Vector2(targetObject.transform.position.x, end.x),
                               new Vector2(targetObject.transform.position.y, end.y), new Vector2(targetObject.transform.position.z, end.z));

            _tweenObjectList.Add(info);
        }
    }