Created
November 21, 2015 02:48
-
-
Save OutlawGameTools/9835d949d9c104e57368 to your computer and use it in GitHub Desktop.
Attached to an animal prefab. For the "Many Game Objects from One Prefab and an Array of Sprites" tutorial.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Animal : MonoBehaviour { | |
private Vector2 origPos; | |
public string animalName; | |
public bool returnToOrigin = false; | |
void Start () { | |
origPos = transform.position; | |
} | |
void OnMouseUp() { | |
if (returnToOrigin) | |
transform.position = origPos; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment