Example #1
0
 // Use this for initialization
 void Start()
 {
     bgmover    = transform.parent.parent.parent.GetComponentInChildren <BgMover> ();
     rTransform = GetComponent <RectTransform> ();
     startPos   = rTransform.localPosition;
     spotToMove = Random.Range(-80, 80);
     rTransform.localPosition = new Vector2(rTransform.localPosition.x, rTransform.localPosition.y + spotToMove);
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     sideSpeed    = 10;
     rTransform   = GetComponent <RectTransform> ();
     fighter      = GetComponent <Image> ();
     startPos     = rTransform.localPosition;
     fighterTrail = GetComponentInChildren <ParticleSystem> ();
     bgMover      = transform.parent.parent.parent.GetComponentInChildren <BgMover> ();
 }