Please could someone take your busy time in converting these scripts
ZombieAnimator.cs
using UnityEngine;
using System.Collections;
public class ZombieAnimator : MonoBehaviour {
public Sprite[] sprites;
public float framesPerSecond;
private SpriteRenderer spriteRenderer;
// Use this for initialization
void Start () {
spriteRenderer = renderer as SpriteRenderer;
}
// Update is called once per frame
void Update () {
int index = (int)(Time.timeSinceLevelLoad * framesPerSecond);
index = index % sprites.Length;
spriteRenderer.sprite = sprites[ index ];
}
}
ZombieController.cs
using UnityEngine;
using System.Collections;
public class ZombieController : MonoBehaviour {
public float moveSpeed;
public float turnSpeed;
private Vector3 moveDirection;
// Use this for initialization
void Start () {
moveDirection = Vector3.right;
}
// Update is called once per frame
void Update () {
// 1
Vector3 currentPosition = transform.position;
// 2
if( Input.GetButton("Fire1") ) {
// 3
Vector3 moveToward = Camera.main.ScreenToWorldPoint( Input.mousePosition );
// 4
moveDirection = moveToward - currentPosition;
moveDirection.z = 0;
moveDirection.Normalize();
}
Vector3 target = moveDirection * moveSpeed + currentPosition;
transform.position = Vector3.Lerp( currentPosition, target, Time.deltaTime );
float targetAngle = Mathf.Atan2(moveDirection.y, moveDirection.x) * Mathf.Rad2Deg;
transform.rotation =
Quaternion.Slerp( transform.rotation,
Quaternion.Euler( 0, 0, targetAngle ),
turnSpeed * Time.deltaTime );
}
}
Please I am new to Unity Android.
I took this from a tut You can find it here:Unity 4.3 2D Tutorial: Getting Started | Kodeco