public EMMotionProperties(MotionType motionType){

		transform = new EMTransform();
		this.motionType = motionType;

		sound = null;
		volume =1;

		autoClose = false;
		autoCloseDelayTime =0;

		isMove = false;
		moveDirection = MotionDirection.Top;
		moveEasing = new EMEasingParameter();

		isRotate = false;
		rotateEasing= new EMEasingParameter();

		isAlpha = false;
		alphaEasing = new EMEasingParameter();

		isScale = false;
		scaleEasing = new EMEasingParameter();

		if (motionType == MotionType.OneShot){
			isInside = true;
		}
		else{
			isInside = false;
		}
	}
    public EMMotionProperties(MotionType motionType)
    {
        transform       = new EMTransform();
        this.motionType = motionType;

        sound  = null;
        volume = 1;

        autoClose          = false;
        autoCloseDelayTime = 0;

        isMove        = false;
        moveDirection = MotionDirection.Top;
        moveEasing    = new EMEasingParameter();

        isRotate     = false;
        rotateEasing = new EMEasingParameter();

        isAlpha     = false;
        alphaEasing = new EMEasingParameter();

        isScale     = false;
        scaleEasing = new EMEasingParameter();

        if (motionType == MotionType.OneShot)
        {
            isInside = true;
        }
        else
        {
            isInside = false;
        }
    }
Exemple #3
0
    private void LaunchMoveProperty(EMMotionProperties properties, bool useCurrentState, bool reverse)
    {
        EMTransform transform = GetTransformFromProperties(properties, useCurrentState);

        Vector3 start = Vector3.zero;
        Vector3 end   = Vector3.zero;
        float   delay = 0;

        if (!useCurrentState)
        {
            delay = properties.moveEasing.delay;
        }

        if (reverse)
        {
            start = transform.position;
            end   = startTransform.position;

            if (useCurrentState)
            {
                start = cachedTransform.anchoredPosition;
            }

            if (properties.moveDirection == EMMotionProperties.MotionDirection.UserDefined && !useCurrentState)
            {
                start = GetPosition2NewAnchor(start, transform.anchorMin, startTransform.anchorMin);
                cachedTransform.anchorMin = startTransform.anchorMin;
                cachedTransform.anchorMax = startTransform.anchorMax;
            }
            else if (useCurrentState)
            {
                start = GetPosition2NewAnchor(start, cachedTransform.anchorMin, startTransform.anchorMin);

                cachedTransform.anchorMin = startTransform.anchorMin;
                cachedTransform.anchorMax = startTransform.anchorMax;
            }
        }
        else
        {
            start = startTransform.position;
            end   = transform.position;

            if (useCurrentState)
            {
                start = cachedTransform.anchoredPosition;
            }

            if (cachedTransform.anchorMin != properties.transform.anchorMin && properties.moveDirection == EMMotionProperties.MotionDirection.UserDefined)
            {
                start = GetPosition2NewAnchor(start, cachedTransform.anchorMin, properties.transform.anchorMin);
                cachedTransform.anchorMin = properties.transform.anchorMin;
                cachedTransform.anchorMax = properties.transform.anchorMax;
            }
        }


        EMEasing.ValueTo(gameObject, motionId, properties.moveEasing.easeType, start, end, properties.moveEasing.time, delay, "On_StartMotion", "On_MoveUI", "On_EndMotion");
        cachedTransform.anchoredPosition = start;
    }
	void OnEnable(){
		inRec = false;
		startRect =  new EMTransform();
	}
Exemple #5
0
    protected EMTransform GetTransformFromProperties(EMMotionProperties prop, bool useCurrent)
    {
        EMTransform transform = new EMTransform();

        if (prop.isMove)
        {
            if (prop.moveDirection != EMMotionProperties.MotionDirection.UserDefined)
            {
                transform.anchorMin = startTransform.anchorMin;
                transform.anchorMax = startTransform.anchorMax;

                Vector3 scale = startTransform.scale;
                if (useCurrent)
                {
                    scale = cachedTransform.localScale;
                }
                if (prop.isScale)
                {
                    scale = prop.transform.scale;
                }

                if (useCurrent)
                {
                    transform.position = ComputePosition(cachedTransform.anchoredPosition, prop.moveDirection, scale, prop.isInside);
                }
                else
                {
                    transform.position = ComputePosition(startTransform.position, prop.moveDirection, scale, prop.isInside);
                }
            }
            else
            {
                transform.anchorMin = prop.transform.anchorMin;
                transform.anchorMax = prop.transform.anchorMax;
                transform.position  = prop.transform.position;
            }
        }
        else
        {
            transform.position  = startTransform.position;
            transform.anchorMin = startTransform.anchorMin;
            transform.anchorMax = startTransform.anchorMax;
        }

        if (prop.isRotate)
        {
            transform.rotation = prop.transform.rotation;
        }
        else
        {
            transform.rotation = startTransform.rotation;
        }

        if (prop.isScale)
        {
            transform.scale = prop.transform.scale;
        }
        else
        {
            transform.scale = startTransform.scale;
        }

        if (prop.isAlpha)
        {
            transform.alpha = prop.transform.alpha;
        }
        else
        {
            transform.alpha = startTransform.alpha;
        }

        return(transform);
    }
Exemple #6
0
 void OnEnable()
 {
     inRec     = false;
     startRect = new EMTransform();
 }
Exemple #7
0
 void OnEnable()
 {
     inRecOpen  = false;
     inRecClose = false;
     startRect  = new EMTransform();
 }
Exemple #8
0
	protected EMTransform GetTransformFromProperties(EMMotionProperties prop, bool useCurrent){

		EMTransform transform = new EMTransform();

		if (prop.isMove){

			if (prop.moveDirection != EMMotionProperties.MotionDirection.UserDefined){
				transform.anchorMin = startTransform.anchorMin;
				transform.anchorMax = startTransform.anchorMax;

				Vector3 scale = startTransform.scale;
				if (useCurrent){
					scale = cachedTransform.localScale;
				}
				if (prop.isScale){
					scale = prop.transform.scale;
				}

				if (useCurrent){
					transform.position = ComputePosition(cachedTransform.anchoredPosition, prop.moveDirection,scale, prop.isInside);
				}
				else{
					transform.position = ComputePosition(startTransform.position, prop.moveDirection,scale, prop.isInside);
				}
			}
			else{
				transform.anchorMin = prop.transform.anchorMin;
				transform.anchorMax = prop.transform.anchorMax;
				transform.position = prop.transform.position;
			}
		}
		else{
			transform.position = startTransform.position;
			transform.anchorMin = startTransform.anchorMin;
			transform.anchorMax = startTransform.anchorMax;

		}

		if (prop.isRotate){
			transform.rotation = prop.transform.rotation;
		}
		else{
			transform.rotation = startTransform.rotation;
		}

		if (prop.isScale){
			transform.scale = prop.transform.scale;
		}
		else{
			transform.scale = startTransform.scale;
		}

		if (prop.isAlpha){
			transform.alpha = prop.transform.alpha;
		}
		else{
			transform.alpha = startTransform.alpha;
		}

		return transform;
	}
	void OnEnable(){
		inRecOpen = false;
		inRecClose = false;
		startRect =  new EMTransform();
	}