Latest News

(P2) :Create  Background Scoll.

b1: Create GameObject Squad

b2: Create Material
Create material using shader: Mobile/Particle/Alpha Blended
b3: Setting Image Background
choise Texture type :Advance, wrap Mode: Repeat
B4: Script Animation
Create File Script name is: AnimatedTexture using parameter Speed is Vector2 
public class AnimatedTexture : MonoBehaviour {

public Vector2 speed = Vector2.zero;

private Vector2 offset = Vector2.zero;
private Material material;
    // Use this for initialization
    void Start ()
    {
        material = GetComponent<Renderer> ().material;

        offset = material.GetTextureOffset ("_MainTex");
}

    // Update is called once per frame
    void Update()
    {
        if (PlayerPrefs.GetInt("IsRunning")==1)
        {
           // flow move to Ox or Oy
            offset += speed * Time.deltaTime;
            material.SetTextureOffset("_MainTex", offset);
        }
    }
}



0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

Pin ThisShare on TumblrShare on Google PlusEmail This
 
Top