예제 #1
0
	/// <summary>
	/// position path tween
	/// </summary>
	public GoTweenConfig positionPath( GoSpline path, bool isRelative = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null )
	{
		var prop = new PositionPathTweenProperty( path, isRelative, false, lookAtType, lookTarget );
		_tweenProperties.Add( prop );
		
		return this;
	}
    public void Event()
    {
        if(firstRun) {
            firstRun = false;
            spline = new GoSpline(eventPath);
            var pathProperty = new PositionPathTweenProperty(spline);

            var config = new GoTweenConfig();
            config.addTweenProperty(pathProperty);

            var tween = new GoTween(PoPCamera.instance.transform, pathLength, config);
            Go.addTween(tween);
            if(multipleTargets) {
                focusTimer = focusPoints[0].time;
            }
        }

        if(multipleTargets) {
            if(focusTimer >= focusPoints[focusIndex].time && focusIndex != focusPoints.Count - 1) {
                focusIndex++;
            }
            Quaternion rotation = Quaternion.LookRotation(focusPoints[focusIndex].focus - PoPCamera.instance.transform.position);
            PoPCamera.instance.transform.rotation = Quaternion.Slerp(PoPCamera.instance.transform.rotation, rotation, 0.4f);
        } else {
            Quaternion rotation = Quaternion.LookRotation(singleTargetPos - PoPCamera.instance.transform.position);
            PoPCamera.instance.transform.rotation = Quaternion.Slerp(PoPCamera.instance.transform.rotation, rotation, 0.4f);
        }

        if(pathLength < 0) {
            PoPCamera.State = Camera_2.CameraState.Normal;
            Destroy(this.gameObject);
        } else
            pathLength -= Time.deltaTime;
    }
    public GoTweenConfig positionPath(GoSpline path, bool isRelative = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null)
    {
        PositionPathTweenProperty item = new PositionPathTweenProperty(path, isRelative, useLocalPosition: false, lookAtType, lookTarget);

        _tweenProperties.Add(item);
        return(this);
    }
예제 #4
0
    /// <summary>
    /// position path tween
    /// </summary>
    public GoTweenConfig localPositionPath(GoSpline path, bool isRelative = false, GoLookAtType lookAtType = GoLookAtType.None, Transform lookTarget = null)
    {
        var prop = new PositionPathTweenProperty(path, isRelative, true, lookAtType, lookTarget);

        _tweenProperties.Add(prop);

        return(this);
    }
    public override bool Equals(object obj)
    {
        if (base.Equals(obj))
        {
            return(_useLocalPosition == ((PositionTweenProperty)obj)._useLocalPosition);
        }
        PositionPathTweenProperty positionPathTweenProperty = obj as PositionPathTweenProperty;

        if (positionPathTweenProperty != null)
        {
            return(_useLocalPosition == positionPathTweenProperty.useLocalPosition);
        }
        return(false);
    }
    public void Event()
    {
        if (firstRun)
        {
            firstRun = false;
            spline   = new GoSpline(eventPath);
            var pathProperty = new PositionPathTweenProperty(spline);

            var config = new GoTweenConfig();
            config.addTweenProperty(pathProperty);

            var tween = new GoTween(PoPCamera.instance.transform, pathLength, config);
            Go.addTween(tween);
            if (multipleTargets)
            {
                focusTimer = focusPoints[0].time;
            }
        }

        if (multipleTargets)
        {
            if (focusTimer >= focusPoints[focusIndex].time && focusIndex != focusPoints.Count - 1)
            {
                focusIndex++;
            }
            Quaternion rotation = Quaternion.LookRotation(focusPoints[focusIndex].focus - PoPCamera.instance.transform.position);
            PoPCamera.instance.transform.rotation = Quaternion.Slerp(PoPCamera.instance.transform.rotation, rotation, 0.4f);
        }
        else
        {
            Quaternion rotation = Quaternion.LookRotation(singleTargetPos - PoPCamera.instance.transform.position);
            PoPCamera.instance.transform.rotation = Quaternion.Slerp(PoPCamera.instance.transform.rotation, rotation, 0.4f);
        }

        if (pathLength < 0)
        {
            PoPCamera.State = Camera_2.CameraState.Normal;
            Destroy(this.gameObject);
        }
        else
        {
            pathLength -= Time.deltaTime;
        }
    }