Esempio n. 1
0
 public override string ToString()
 {
     return($"Tween ({GetType().Name})\n"
            + (Speed > 0 ? $"Speed: {Speed}\n" : $"Duration: {Duration}\n")
            + $"Delta Time: {DeltaTimeType}\n"
            + $"Ease Type: {(CustomEase != null ? "Custom Ease" : EaseType.ToString())}\n"
            + $"Loop: {LoopType.ToString()} {(LoopType != LoopType.None ? "(Amount: " + (LoopAmount < 1 ? "Infinite" : LoopAmount.ToString()) + ")" : string.Empty)}\n"
            + $"Callbacks: {(onInitialize != null ? "OnInitialize " : string.Empty)} {(onUpdate != null ? "OnUpdate " : string.Empty)} {(onCompleted != null ? "OnCompleted " : string.Empty)} {(onStepCompleted != null ? "OnLoopStepCompleted " : string.Empty)}");
 }
        private void FlipbookSetup_Load(object sender, EventArgs e)
        {
            string[] values = Enum.GetNames(typeof(LoopTypes));
            int      index  = 0;

            foreach (string value in values)
            {
                int temp = flipbookStyle.Items.Add(value);
                if (value == LoopType.ToString())
                {
                    index = temp;
                }
            }
            flipbookStyle.SelectedIndex = index;

            frameSequenceText.Text = FrameSequence;
            endFrame.Text          = Frames.ToString();
            startFrame.Text        = StartFrame.ToString();
            gridXText.Text         = FramesX.ToString();
            gridYText.Text         = FramesY.ToString();
        }
Esempio n. 3
0
	/// <summary>
	/// Adds supplied Euler angles in degrees to a GameObject's rotation over time.
	/// </summary>
	/// <param name="amount">
	/// A <see cref="Vector3"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easetype">
	/// A <see cref="EaseType"/>
	/// </param> 
	/// <param name="looptype">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void RotateAdd(this GameObject go,Vector3 amount,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.RotateAdd(go,iTween.Hash("amount",amount,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
Esempio n. 4
0
	/// <summary>
	/// Instantly changes an AudioSource's volume and pitch then returns it to it's starting volume and pitch over time. Default AudioSource attached to GameObject will be used.
	/// </summary>
	/// <param name="volume"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="pitch"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="time"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay"> 
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="looptype">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void AudioFrom(this GameObject go,float volume,float pitch,float time,float delay,LoopType loopType){
		iTween.AudioFrom(go,iTween.Hash("volume",volume,"pitch",pitch,"time",time,"delay",delay,"looptype",loopType.ToString()));
	}
Esempio n. 5
0
	/// <summary>
	/// Changes a GameObject's position over time along a supplied path.
	/// </summary>
	/// <param name="go">
	/// A <see cref="GameObject"/>
	/// </param>
	/// <param name="path">
	/// A <see cref="Transform[]"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easeType">
	/// A <see cref="EaseType"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void MoveTo(this GameObject go,Transform[] path,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.MoveTo(go,iTween.Hash("path",path,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
Esempio n. 6
0
	/// <summary>
	/// Changes a GameObject's position over time to a supplied destination.
	/// </summary>
	/// <param name="position">
	/// A <see cref="Vector3"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easeType">
	/// A <see cref="EaseType"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void MoveTo(this GameObject go,Vector3 position,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.MoveTo(go,iTween.Hash("position",position,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
Esempio n. 7
0
	/// <summary>
	/// Rotates a GameObject to look at the supplied Vector3 over time.
	/// </summary>
	/// <param name="lookTarget">
	/// A <see cref="Vector3"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easeType">
	/// A <see cref="EaseType"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void LookTo(this GameObject go,Vector3 lookTarget,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.LookTo(go,iTween.Hash("lookTarget",lookTarget,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
Esempio n. 8
0
	/// <summary>
	/// Changes a GameObject's alpha value over time.  If a GUIText or GUITexture component is attached, it will become the target of the animation. Identical to using ColorTo and using the "a" parameter.
	/// </summary>
	/// <param name="alpha">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void FadeTo(this GameObject go,float alpha,float time,float delay,LoopType loopType){
		iTween.FadeTo(go,iTween.Hash("alpha",alpha,"time",time,"delay",delay,"looptype",loopType.ToString()));	
	}
Esempio n. 9
0
	/// <summary>
	/// Changes a GameObject's color values over time.  If a GUIText or GUITexture component is attached, they will become the target of the animation.
	/// </summary>
	/// <param name="color">
	/// A <see cref="Color"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void ColorTo(this GameObject go,Color color,float time,float delay,LoopType loopType){
		iTween.ColorTo(go,iTween.Hash("color",color,"time",time,"delay",delay,"looptype",loopType.ToString()));	
	}
Esempio n. 10
0
	/// <summary>
	/// Changes a GameObject's scale over time.
	/// </summary>
	/// <param name="scale">
	/// A <see cref="Vector3"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easeType">
	/// A <see cref="EaseType"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void ScaleTo(this GameObject go,Vector3 scale,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.ScaleTo(go,iTween.Hash("scale",scale,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
Esempio n. 11
0
	/// <summary>
	/// Instantly changes a GameObject's Euler angles in degrees then returns it to it's starting rotation over time.
	/// </summary>
	/// <param name="rotation">
	/// A <see cref="Vector3"/>
	/// </param>
	/// <param name="time">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="delay">
	/// A <see cref="System.Single"/>
	/// </param>
	/// <param name="easeType">
	/// A <see cref="EaseType"/>
	/// </param>
	/// <param name="loopType">
	/// A <see cref="LoopType"/>
	/// </param>
	public static void RotateFrom(this GameObject go,Vector3 rotation,float time,float delay,EaseType easeType,LoopType loopType){
		iTween.RotateFrom(go,iTween.Hash("rotation",rotation,"time",time,"delay",delay,"easeType",easeType.ToString(),"looptype",loopType.ToString()));
	}
Esempio n. 12
0
    public void StartAnim(bool needCollider = true)
    {
        try
        {
            boxCollider         = transform.GetChild(0).GetComponent <BoxCollider>();
            boxCollider.enabled = needCollider;
            meshMat             = transform.GetChild(0).GetChild(0).GetComponent <SkinnedMeshRenderer>().sharedMaterial;
        }
        catch (Exception e)
        {
            //throw;
            Debug.Log("*Warning*<color=yellow>" + "EnemyControl Try Exception" + "</color>");
        }

        if (loopType == LoopType.Pinpong)
        {
            isRevert = !isRevert;
            try
            {
                if (!moveToPath)
                {
                    transform.position = (Vector3)iTweenPath.GetPath(enemyType.ToString()).GetValue(0);
                }
                iTween.MoveTo(gameObject, iTween.Hash(
                                  "path", iTweenPath.GetPath(enemyType.ToString()),
                                  "movetopath", moveToPath,
                                  "delay", stayTime,
                                  "easetype", easeType,
                                  "looptype", iTween.LoopType.none,
                                  "speed", speed,
                                  "orienttopath", true,
                                  "lookTime", 1.1,
                                  "axis", "y",
                                  "oncomplete", "myCompleteFun",
                                  "oncompletetarget", gameObject));
            }
            catch (Exception e)
            {
                Debug.Log("*Warning*<color=blue>" + "EnemyControl GetPath Exception:" + e + "</color>");
            }
        }
        else
        {
            try
            {
                if (!moveToPath)
                {
                    transform.position = (Vector3)iTweenPath.GetPath(enemyType.ToString()).GetValue(0);
                }
                iTween.MoveTo(gameObject, iTween.Hash(
                                  "path", iTweenPath.GetPath(enemyType.ToString()),
                                  "movetopath", moveToPath,
                                  "delay", stayTime,
                                  "easetype", easeType,
                                  "looptype", loopType.ToString().ToLower(),
                                  "speed", speed,
                                  "orienttopath", true,
                                  "lookTime", 1.1,
                                  "axis", "y"));
            }
            catch (Exception)
            {
            }
        }
    }
Esempio n. 13
0
 public override string ToString()
 {
     return("levelNumber = " + levelNumber + " - numberDotsToCreate = " + numberDotsToCreate + " - numberDotsOnCircle = " + numberDotsOnCircle + " - lineRadius = " + lineRadius + " - rotateDelay = " + rotateDelay
            + " - rotateVector = " + rotateVector + " - rotateEase " + rotateEase.ToString() + " - rotateLoopType = " + rotateLoopType.ToString());
 }
Esempio n. 14
0
 public void PlayRotation()
 {
     GetComponent <Transform>().localEulerAngles = initialRotation;
     iTween.ValueTo(this.gameObject, iTween.Hash("delay", delayRotation, "from", GetComponent <Transform>().localEulerAngles, "to", targetRotation,
                                                 "time", timeRotation, "looptype", LoopTypeRotation.ToString(), "onupdate", "RotateObject", "oncomplete", "OnRotationTweenCompleted", "easetype", EaseTypeRotation.ToString()));
 }
Esempio n. 15
0
 public void PlayScale()
 {
     GetComponent <Transform>().localScale = initialScale;
     iTween.ValueTo(this.gameObject, iTween.Hash("delay", delayScale, "from", GetComponent <Transform>().localScale, "to", targetScale, "time", timeScale,
                                                 "looptype", LoopTypeScale.ToString(), "onupdate", "ScaleObject", "oncomplete", "OnScaleTweenCompleted", "easetype", EaseTypeScale.ToString()));
 }
Esempio n. 16
0
 public void PlayUIMovement()
 {
     GetComponent <RectTransform>().anchoredPosition = initialPosition2D;
     iTween.ValueTo(this.gameObject, iTween.Hash("delay", delayMovement, "from", GetComponent <RectTransform>().anchoredPosition, "to", targetPosition2D,
                                                 "time", timeMovement, "looptype", LoopTypeMovement.ToString(), "onupdate", "MoveGuiElement", "oncomplete", "OnMovementTweenCompleted", "easetype", EaseTypeMovement.ToString()));
 }