• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UVAnimation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UVAnimation的典型用法代码示例。如果您正苦于以下问题:C# UVAnimation类的具体用法?C# UVAnimation怎么用?C# UVAnimation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UVAnimation类属于命名空间,在下文中一共展示了UVAnimation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Start

    // Use this for initialization
    public override void Start()
    {
        base.Start();

        GetComponent<SimpleFollow>().enabled = false;
        sprite = spriteManager.AddSprite(gameObject, width, height, 0, 127, 128, 128, false);

        // Create and setup anims
        UVAnimation anim = new UVAnimation();
        var firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 127));
        var cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 14, 15);
        anim.name = "Idle";
        anim.loopCycles = -1;

        sprite.AddAnimation(anim);

        anim = new UVAnimation();
        firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 383));
        cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 16, 15);
        anim.name = "Die";
        anim.loopCycles = 0;

        sprite.AddAnimation(anim);

        sprite.PlayAnim("Idle");
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:29,代码来源:DiverControllerYellow.cs


示例2: Start

    // Use this for initialization
    void Start()
    {
        sprite = spriteManager.AddSprite(gameObject, width, height, 0, 127, 128, 128, false);

        // Create and setup anims
        UVAnimation anim = new UVAnimation();
        var firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 127));
        var cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 13, 15);
        anim.name = "Idle";
        anim.loopCycles = -1;

        sprite.AddAnimation(anim);

        anim = new UVAnimation();
        firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 127));
        cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 13, 30);
        anim.name = "Arm";
        anim.loopCycles = -1;

        sprite.AddAnimation(anim);

        anim = new UVAnimation();
        firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(256, 383));
        cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 8, 30);
        anim.name = "Explode";
        anim.loopCycles = 1;

        sprite.AddAnimation(anim);

        sprite.PlayAnim("Idle");
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:35,代码来源:BombController.cs


示例3: Start

    public override void Start()
    {
        base.Start();

        sprite = spriteManager.AddSprite(gameObject, width, height, 0, 127, 128, 128, false);

        // Create and setup anims
        UVAnimation anim = new UVAnimation();
        var firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 127));
        var cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 14, 15);
        anim.name = "Idle";
        anim.loopCycles = -1;

        sprite.AddAnimation(anim);

        anim = new UVAnimation();
        firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 383));
        cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 16, 15);
        anim.name = "Die";
        anim.loopCycles = 0;

        sprite.AddAnimation(anim);

        sprite.PlayAnim("Idle");

        dolphin = GameObject.Find("DolphinSprite");
        Util.Assert(dolphin != null);
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:30,代码来源:DiverControllerRed.cs


示例4: Start

    // Use this for initialization
    void Start()
    {
        sprite = spriteManager.AddSprite(gameObject, width, height, 0, 511, 512, 512, false);

        // Create and setup anims
        UVAnimation anim = new UVAnimation();
        var firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 511));
        var cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(512, 512));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 16, 15);
        anim.name = "Idle";
        anim.loopCycles = -1;

        sprite.AddAnimation(anim);

        anim = new UVAnimation();
        firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 1023));
        cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(512, 512));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 19, 15);
        anim.name = "Surprise";
        anim.loopCycles = 0;

        sprite.AddAnimation(anim);

        sprite.PlayAnim("Idle");
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:26,代码来源:ClamHortonsBitsController.cs


示例5: Start

    void Start()
    {
        var transTest = new GameObject("MaterialTransform_"+ this.name);

        transTest.transform.position = transform.TransformPoint(transTest.transform.position);
        transTest.transform.position += new Vector3(0, 0, _depthLayer) * _depthScaleFactor;

        transTest.transform.localScale = new Vector3(_scaleX, _scaleY, 0.5f);

        _sprite = _spriteManager.AddSprite(transTest, _width, _height, 0, (int)_cellSize.x-1, (int)_cellSize.x, (int)_cellSize.x, false);

        for (var i = 0; i < _anims.Length; i++)
        {
            var anim = new UVAnimation();

            var firstFrameCoords = new Vector2(
                //_anims[i].firstFrame.x * _cellSize.x,
                0,
                _anims[i].firstFrame.y * _cellSize.y);

            var firstFrame = _spriteManager.PixelCoordToUVCoord(firstFrameCoords);
            var cellSize = _spriteManager.PixelSpaceToUVSpace(_cellSize);
            anim.BuildUVAnim(firstFrame, cellSize, _anims[i].columns, _anims[i].rows, _anims[i].totalCells, _anims[i].fps, (int)(_anims[i].firstFrame.x));
            anim.name = _anims[i].name;
            anim.loopCycles = _anims[i].loopCycles;
            _sprite.AddAnimation(anim);
        }

        _currentAnimation = _defaultAnimation;
        _sprite.PlayAnim(_defaultAnimation);
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:31,代码来源:AnimationHandler.cs


示例6: CreateAnimation

	protected UVAnimation CreateAnimation(string animName, Vector2 startUVPos, Vector2 UVSize, int animCells, int loopCycles, bool pingPongAnim, float framerate){
		UVAnimation anim = new UVAnimation();
		anim.name = animName;
		anim.loopCycles = loopCycles;
		anim.framerate = framerate;
		if(pingPongAnim)
			anim.loopReverse = true;
		
		anim.BuildUVAnim(startUVPos, UVSize, spriteSheetCols, spriteSheetRows, animCells, framerate);		
		return anim;
	}
开发者ID:pravusjif,项目名称:PravusUnityTests,代码行数:11,代码来源:Totem.cs


示例7: Start

 // Use this for initialization
 void Start()
 {
     sprite = spriteManager.AddSprite(this.gameObject,2,2,new Vector2(.5f,.5f), new Vector2(.25f, .5f), new Vector3(0,0,0), true);
     stabbing = new UVAnimation();
     stabbing.name="stabbing";
     stabbing.SetAnim(stabbing.BuildUVAnim(new Vector2(.5f,.5f),new Vector2(.25f,.5f),2,2,3,2));
     stabbing.loopCycles=-1; // makes animation loop infinitely
     stabbing.loopReverse = true; // makes animation go in reverse after it's completed
     sprite.AddAnimation(stabbing);
     sprite.PlayAnim("stabbing");
 }
开发者ID:harrisse,项目名称:AdventureTime,代码行数:12,代码来源:FinnTestStabbing.cs


示例8: Start

    // Use this for initialization
    void Start()
    {
        width = collider.bounds.size.x * 2 + 0.15f;
        height = collider.bounds.size.y * 2 + 0.15f;

        sprite = spriteManager.AddSprite(gameObject, width, height, 0, 127, 128, 128, false);

        // Create and setup anims
        UVAnimation anim = new UVAnimation();
        var firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 127));
        var cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 11, 15);
        anim.name = "Idle";
        anim.loopCycles = -1;

        sprite.AddAnimation(anim);
        sprite.PlayAnim("Idle");
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:19,代码来源:MineController.cs


示例9: DrawAnimation

	public void DrawAnimation() {
		// Put sprite on the client object
		GameObject totem = GameObject.Find("TotemMono");
		totem.renderer.enabled = false;
		Sprite totemSprite = spriteManager.AddSprite(totem, 1f, 1f, new Vector2(0, 0.5f), new Vector2(0.5f, 0.5f), Vector3.zero, false);
		
		// Set up animation
		UVAnimation anim = new UVAnimation();
		anim.name = "animation1";
		anim.loopCycles = -1;
		anim.framerate = framerate;
		
		anim.BuildUVAnim(new Vector2(0, 0.5f), new Vector2(0.5f, 0.5f), 2, 2, 4, framerate);
		
		// Prepare sprite
		totemSprite.AddAnimation(anim);
		totemSprite.PlayAnim("animation1");
	}
开发者ID:pravusjif,项目名称:PravusUnityTests,代码行数:18,代码来源:SceneSprites.cs


示例10: drawAnim

    public void drawAnim(ArrayList polesWithLights)
    {
        print (polesWithLights.Count);
        int len = polesWithLights.Count;
        clients = new Sprite[len*amount];
        xForms = new GameObject[len*amount];
        initPositions = new Vector3[len * amount];

        flaps = new UVAnimation[7];

        for (int i = 0; i < 7; i++) {
            flaps[i] = new UVAnimation ();
            flaps[i].name = "flap_"+(7-i);
            flaps[i].loopCycles = -1;
            flaps[i].framerate = 14;
            flaps[i].BuildUVAnim (new Vector2 (0f, (i+7f) / 14f), new Vector2 (1f / 14f, 1f / 14f), 14, 14, 14, 14);
        }

        int ct = 0;
        int lampCount = 0;
        for (int j = 0; j < polesWithLights.Count; j++) {
            for (int i = 0; i < amount; i++) {
                Transform pole = (Transform) polesWithLights[j];
                //				print (pole);
                GameObject lamp = pole.Find("bulb").gameObject;
                Vector3 p = new Vector3(lamp.transform.position.x+Random.Range(-2,2),lamp.transform.position.y-Random.Range(0,15),lamp.transform.position.z+Random.Range(-2,2));
                initPositions[ct] = p;
                xForms[ct] = Instantiate (gClient, p, Quaternion.identity) as GameObject;
                xForms[ct].transform.parent = GameObject.Find("parent/poles").transform;
                Sprite tempClient = spManager.AddSprite (xForms [ct], 1f, 1f, new Vector2 (0f, 7f / 14f), new Vector2 (1f / 14f, 1f / 14f), Vector3.zero, true);
                clients [ct] = tempClient;//spManager.AddSprite (xForms [ct], 1f, 1f, new Vector2 (0f, 7f / 14f), new Vector2 (1f / 14f, 1f / 14f), Vector3.zero, true);
                spManager.SetBillboarded (clients [ct]);
                for (int q = 0; q < 7; q++) {
                    UVAnimation tFlap = flaps [q];
                    clients [ct].AddAnimation (tFlap);
                }
                clients [ct].PlayAnim ("flap_1");
                ct++;
                lampCount++;
                //				print (i+ " " + j + " " + ct);
            }
        }
        built = true;
    }
开发者ID:dlobser,项目名称:beach,代码行数:44,代码来源:particleTestForPoles.cs


示例11: Start

    // Use this for initialization
    void Start()
    {
        sprite = spriteManager.AddSprite(gameObject, width, height, 0, 127, 128, 128, false);

        // Create and setup anims
        UVAnimation anim = new UVAnimation();
        var firstFrame = spriteManager.PixelCoordToUVCoord(new Vector2(0, 127));
        var cellSize = spriteManager.PixelSpaceToUVSpace(new Vector2(128, 128));
        anim.BuildUVAnim(firstFrame, cellSize, 8, 8, 10, 15);
        anim.name = "Idle";
        anim.loopCycles = 0;

        sprite.AddAnimation(anim);
        sprite.PlayAnim("Idle");

        sprite.SetAnimCompleteDelegate(delegate()
        {
            Destroy(transform.parent.gameObject);
        });
    }
开发者ID:svermeulen,项目名称:HalifaxGameJam2012,代码行数:21,代码来源:BubbleBurstController.cs


示例12: PlayAnimInReverse

	/// <summary>
	/// Like PlayAnim, but plays the animation in reverse.
	/// See <see cref="PlayAnim"/>.
	/// </summary>
	/// <param name="anim">Reference to the animation to play in reverse.</param>
	public void PlayAnimInReverse(UVAnimation anim)
	{
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
		if (deleted || !gameObject.activeInHierarchy)
#else
		if (deleted || !gameObject.active)
#endif
			return;

		curAnim = anim;
		curAnim.Reset();
		curAnim.PlayInReverse();

		// Ensure the framerate is not 0 so we don't
		// divide by zero:
		if (anim.framerate != 0.0f)
		{
			timeBetweenAnimFrames = 1f / anim.framerate;
		}
		else
		{
			timeBetweenAnimFrames = 1f; // Just some dummy value since it won't be used
		}

		timeSinceLastFrame = timeBetweenAnimFrames;

		// Only add to the animated list if
		// the animation has more than 1 frame:
		if ((anim.GetFrameCount() > 1 || anim.onAnimEnd != UVAnimation.ANIM_END_ACTION.Do_Nothing) && anim.framerate != 0.0f)
		{
			StepAnim(0);
			// Start coroutine
			if (!animating)
			{
				//animating = true;
				AddToAnimatedList();
				//StartCoroutine(AnimationPump());
			}
		}
		else
		{
			// Make sure we are no longer in the animation pump:
			PauseAnim();

			// Since this is a single-frame anim,
			// call our delegate before setting
			// the frame so that our behavior is
			// consistent with multi-frame anims:
			if (animCompleteDelegate != null)
				animCompleteDelegate(this);

			StepAnim(0);
		}
	}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:59,代码来源:AutoSpriteBase.cs


示例13: PlayAnim

	/// <summary>
	/// Starts playing the specified animation
	/// Note: this doesn't resume from a pause,
	/// it completely restarts the animation. To
	/// unpause, use <see cref="UnpauseAnim"/>.
	/// </summary>
	/// <param name="anim">A reference to the animation to play.</param>
	public void PlayAnim(UVAnimation anim)
	{
		PlayAnim(anim, 0);
	}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:11,代码来源:AutoSpriteBase.cs


示例14: StepAnim

	// Steps to the next frame of sprite animation
	public override bool StepAnim(float time)
	{
		if (curAnim == null)
			return false;

		timeSinceLastFrame += Mathf.Max(0, time);
		//timeSinceLastFrame += time;

		framesToAdvance = (timeSinceLastFrame / timeBetweenAnimFrames);

		// If there's nothing to do, return:
		if (framesToAdvance < 1)
		{
			if (crossfadeFrames)
				SetColor(new Color(1f, 1f, 1f, (1f - framesToAdvance)));
			return true;
		}

		//timeSinceLastFrame -= timeBetweenAnimFrames * (float)framesToAdvance;

		while (framesToAdvance >= 1f)
		{
			if (curAnim.GetNextFrame(ref frameInfo))
			{
#if SPRITE_FRAME_DELEGATE
				// Notify the delegate:
				if(framesToAdvance >= 1f)
					if (animFrameDelegate != null)
						animFrameDelegate(this, curAnim.GetCurPosition());
#endif
				framesToAdvance -= 1f;
				timeSinceLastFrame -= timeBetweenAnimFrames;
			}
			else
			{
				// We reached the end of our animation
				if (crossfadeFrames)
					SetColor(Color.white);

				// See if we should revert to a static appearance,
				// default anim, or do nothing, etc:
				switch (curAnim.onAnimEnd)
				{
					case UVAnimation.ANIM_END_ACTION.Do_Nothing:
						PauseAnim();

						// Update mesh UVs:
						uvRect = frameInfo.uvs;
						SetBleedCompensation();

						// Resize if selected:
						if (autoResize || pixelPerfect)
							CalcSize();
						break;

					case UVAnimation.ANIM_END_ACTION.Revert_To_Static:
						RevertToStatic();
						break;

					case UVAnimation.ANIM_END_ACTION.Play_Default_Anim:
						// Notify the delegates:
						/*
						#if SPRITE_FRAME_DELEGATE
												if (animFrameDelegate != null)
													animFrameDelegate(this, curAnim.GetCurPosition());
						#endif
						*/

						if (animCompleteDelegate != null)
							animCompleteDelegate(this);

						// Play the default animation:
						PlayAnim(defaultAnim);
						return false;

					case UVAnimation.ANIM_END_ACTION.Hide:
						Hide(true);
						break;
					case UVAnimation.ANIM_END_ACTION.Deactivate:
#if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
						gameObject.SetActive(false);
#else
						gameObject.active = false;
#endif
						break;
					case UVAnimation.ANIM_END_ACTION.Destroy:
						// Notify the delegates:
						/*
						#if SPRITE_FRAME_DELEGATE
												if (animFrameDelegate != null)
													animFrameDelegate(this, curAnim.GetCurPosition());
						#endif
						*/
						if (animCompleteDelegate != null)
							animCompleteDelegate(this);

						Delete();
						Destroy(gameObject);
						break;
//.........这里部分代码省略.........
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:101,代码来源:AutoSpriteBase.cs


示例15: CopyAll

	/// <summary>
	/// Copies all the attributes of another sprite,
	/// including its edit-time TextureAnimations.
	/// </summary>
	/// <param name="s">A reference to the sprite to be copied.</param>
	public virtual void CopyAll(SpriteRoot s)
	{
		AutoSpriteBase sp;

		base.Copy(s);

		// Check the type:
		if (!(s is AutoSpriteBase))
			return;

		sp = (AutoSpriteBase)s;

		States = new TextureAnim[sp.States.Length];

		for (int i = 0; i < States.Length; ++i)
		{
			States[i] = new TextureAnim();
			States[i].Copy(sp.States[i]);
		}

		animations = new UVAnimation[States.Length];

		for (int i = 0; i < States.Length; ++i)
		{
			animations[i] = new UVAnimation();
			animations[i].SetAnim(States[i], i);
		}

		doNotTrimImages = sp.doNotTrimImages;
	}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:35,代码来源:AutoSpriteBase.cs


示例16: SetFrame

	/// <summary>
	/// Sets the sprite to display the given frame of the
	/// specified animation.
	/// </summary>
	/// <param name="anim">The animation containing the desired frame.</param>
	/// <param name="frameNum">The 0-based index of the frame to be displayed.</param>
	public void SetFrame(UVAnimation anim, int frameNum)
	{
		PlayAnim(anim);
		if (IsAnimating())
			PauseAnim();
		SetCurFrame(frameNum);
	}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:13,代码来源:AutoSpriteBase.cs


示例17: Awake

	protected override void Awake()
	{
		base.Awake();

		animations = new UVAnimation[States.Length];

		for (int i = 0; i < States.Length; ++i)
		{
			animations[i] = new UVAnimation();
			animations[i].SetAnim(States[i], i);
		}
	}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:12,代码来源:AutoSpriteBase.cs


示例18: AddAnimation

	//-----------------------------------------------------------------
	// Animation-related routines:
	//-----------------------------------------------------------------


	/// <summary>
	/// Adds an animation to the sprite for its use.
	/// </summary>
	/// <param name="anim">The animation to add</param>
	public void AddAnimation(UVAnimation anim)
	{
		UVAnimation[] temp;
		temp = animations;

		animations = new UVAnimation[temp.Length + 1];
		temp.CopyTo(animations, 0);

		animations[animations.Length - 1] = anim;
	}
开发者ID:uptopgames,项目名称:rhythm,代码行数:19,代码来源:PackedSprite.cs


示例19: AppendClip

	/// <summary>
	/// Appends UV animation clip to the end of the animation sequence.
	/// </summary>
	/// <param name="clip">Animation clip to append.</param>
	public void AppendClip(UVAnimation clip)
	{
		UVAnimation[] temp;
		temp = clips;

		clips = new UVAnimation_Auto[clips.Length + 1];
		temp.CopyTo(clips, 0);

		clips[clips.Length - 1] = (UVAnimation_Auto)clip;

		CalcDuration();
	}
开发者ID:juliancruz87,项目名称:transpp,代码行数:16,代码来源:SpriteBase.cs


示例20: InitAffectors

    protected List<Affector> InitAffectors(EffectNode node)
    {
        List<Affector> AffectorList = new List<Affector>();

        if (UVAffectorEnable)
        {
            UVAnimation uvAnim = new UVAnimation();
            if (UVType == 1)
            {
                float perWidth = OriUVDimensions.x / Cols;
                float perHeight = Mathf.Abs(OriUVDimensions.y / Rows);
                Vector2 cellSize = new Vector2(perWidth, perHeight);
                uvAnim.BuildUVAnim(OriTopLeftUV, cellSize, Cols, Rows, Cols * Rows);
            }
            UVDimension = uvAnim.UVDimensions[0];
            UVTopLeft = uvAnim.frames[0];

            if (uvAnim.frames.Length != 1)
            {
                uvAnim.loopCycles = LoopCircles;
                Affector aft = new UVAffector(uvAnim, UVTime, node, RandomStartFrame);
                AffectorList.Add(aft);
            }
        }
        else
        {
            UVDimension = OriUVDimensions;
            UVTopLeft = OriTopLeftUV;
        }

        if (RotAffectorEnable && RotateType != RSTYPE.NONE)
        {
            Affector aft;
            if (RotateType == RSTYPE.CURVE)
                aft = new RotateAffector(RotateCurve, node);
            else
                aft = new RotateAffector(DeltaRot, node);
            AffectorList.Add(aft);
        }
        if (ScaleAffectorEnable && ScaleType != RSTYPE.NONE)
        {
            Affector aft;

            if (UseSameScaleCurve)
                ScaleYCurve = ScaleXCurve;

            if (ScaleType == RSTYPE.CURVE)
                aft = new ScaleAffector(ScaleXCurve, ScaleYCurve, node);
            else
                aft = new ScaleAffector(DeltaScaleX, DeltaScaleY, node);
            AffectorList.Add(aft);
        }
        if (ColorAffectorEnable /*&& ColorAffectType != 0*/)
        {
            ColorAffector aft = new ColorAffector(this, node);
            AffectorList.Add(aft);
        }
        if (JetAffectorEnable)
        {
            Affector aft = new JetAffector(JetMag,JetMagType,JetCurve,node);
            AffectorList.Add(aft);
        }
        if (VortexAffectorEnable)
        {
            Affector aft;
            aft = new VortexAffector(VortexObj, VortexMagType, VortexMag, VortexCurve, VortexDirection, VortexInheritRotation, node);

            AffectorList.Add(aft);
        }
        if (UVRotAffectorEnable)
        {
            Affector aft;

            float xscroll = UVRotXSpeed;
            float yscroll = UVRotYSpeed;
            if (RandomUVRotateSpeed)
            {
                xscroll = Random.Range(UVRotXSpeed,UVRotXSpeedMax);
                yscroll = Random.Range(UVRotYSpeed,UVRotYSpeedMax);
            }

            aft = new UVRotAffector(xscroll, yscroll, node);
            AffectorList.Add(aft);
        }

        if (GravityAffectorEnable)
        {
            Affector aft;
            aft = new GravityAffector(GravityObject, GravityAftType, GravityMagType, IsGravityAccelerate,GravityDirection, GravityMag, GravityCurve, node);
            AffectorList.Add(aft);

            if (GravityAftType == GAFTTYPE.Spherical && GravityObject == null)
            {
                Debug.LogWarning("Gravity Object is missing, automatically set to effect layer self:" + gameObject.name);
                GravityObject = transform;
            }

        }
        if (AirAffectorEnable)
        {
//.........这里部分代码省略.........
开发者ID:sylafrs,项目名称:rugby,代码行数:101,代码来源:EffectLayer.cs



注:本文中的UVAnimation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Udbus类代码示例发布时间:2022-05-24
下一篇:
C# UV类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap