1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 09:16:02 +08:00

Added Material DOTiling and DOOffset shortcuts

This commit is contained in:
Daniele Giardini 2015-05-08 11:33:55 +02:00
parent a2dd1818c6
commit 8aab0658be
27 changed files with 301 additions and 1 deletions

View File

@ -949,6 +949,32 @@
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture offset to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture offset property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture scale to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture scale property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOVector(UnityEngine.Material,UnityEngine.Vector4,System.String,System.Single)">
<summary>Tweens a Material's named Vector property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>

View File

@ -949,6 +949,32 @@
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture offset to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture offset property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture scale to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture scale property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOVector(UnityEngine.Material,UnityEngine.Vector4,System.String,System.Single)">
<summary>Tweens a Material's named Vector property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>

View File

@ -949,6 +949,32 @@
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture offset to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture offset property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture scale to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture scale property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOVector(UnityEngine.Material,UnityEngine.Vector4,System.String,System.Single)">
<summary>Tweens a Material's named Vector property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>

View File

@ -0,0 +1,14 @@
using UnityEngine;
using System.Collections;
using DG.Tweening;
public class TextureTilingAndOffset : BrainBase
{
public Renderer rend;
void Start()
{
rend.material.DOTiling(new Vector2(3, 3), 2).SetLoops(-1, LoopType.Yoyo);
rend.material.DOOffset(new Vector2(1, 0), "_Detail", 2).SetEase(Ease.Linear).SetLoops(-1, LoopType.Incremental);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 65dfb16b254b0c14a93b4c9801fb9c0d
timeCreated: 1431076470
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e71f67ccffdad8b45be5fbcf29bf04d8
timeCreated: 1431076464
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5802d8ca92f7bf84c9717237c42b3243
timeCreated: 1431076590
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -0,0 +1,55 @@
fileFormatVersion: 2
guid: b5bf3187386e9544ea239f2dbfbc8989
timeCreated: 1431076560
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

View File

@ -0,0 +1,55 @@
fileFormatVersion: 2
guid: 8c5e1a0ba4604a044bb2b668154f51ac
timeCreated: 1431076559
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// <summary>DOTween's version</summary>
public static readonly string Version = "1.0.685";
public static readonly string Version = "1.0.690";
///////////////////////////////////////////////
// Options ////////////////////////////////////

View File

@ -218,6 +218,50 @@ namespace DG.Tweening
return DOTween.To(() => target.GetFloat(property), x => target.SetFloat(property, x), endValue, duration).SetTarget(target);
}
/// <summary>Tweens a Material's texture offset to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="duration">The duration of the tween</param>
public static Tweener DOOffset(this Material target, Vector2 endValue, float duration)
{
return DOTween.To(() => target.mainTextureOffset, x => target.mainTextureOffset = x, endValue, duration).SetTarget(target);
}
/// <summary>Tweens a Material's named texture offset property to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="property">The name of the material property to tween</param>
/// <param name="duration">The duration of the tween</param>
public static Tweener DOOffset(this Material target, Vector2 endValue, string property, float duration)
{
if (!target.HasProperty(property)) {
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(property);
return null;
}
return DOTween.To(() => target.GetTextureOffset(property), x => target.SetTextureOffset(property, x), endValue, duration).SetTarget(target);
}
/// <summary>Tweens a Material's texture scale to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="duration">The duration of the tween</param>
public static Tweener DOTiling(this Material target, Vector2 endValue, float duration)
{
return DOTween.To(() => target.mainTextureScale, x => target.mainTextureScale = x, endValue, duration).SetTarget(target);
}
/// <summary>Tweens a Material's named texture scale property to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="property">The name of the material property to tween</param>
/// <param name="duration">The duration of the tween</param>
public static Tweener DOTiling(this Material target, Vector2 endValue, string property, float duration)
{
if (!target.HasProperty(property)) {
if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(property);
return null;
}
return DOTween.To(() => target.GetTextureScale(property), x => target.SetTextureScale(property, x), endValue, duration).SetTarget(target);
}
/// <summary>Tweens a Material's named Vector property to the given value.
/// Also stores the material as the tween's target so it can be used for filtered operations</summary>
/// <param name="endValue">The end value to reach</param>

View File

@ -949,6 +949,32 @@
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture offset to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOOffset(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture offset property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.Single)">
<summary>Tweens a Material's texture scale to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTiling(UnityEngine.Material,UnityEngine.Vector2,System.String,System.Single)">
<summary>Tweens a Material's named texture scale property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>
<param name="endValue">The end value to reach</param>
<param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOVector(UnityEngine.Material,UnityEngine.Vector4,System.String,System.Single)">
<summary>Tweens a Material's named Vector property to the given value.
Also stores the material as the tween's target so it can be used for filtered operations</summary>

Binary file not shown.