Last active
December 20, 2017 06:40
-
-
Save komagata/7658fc820f6e2f68775ee71dec7f0170 to your computer and use it in GitHub Desktop.
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Mole : MonoBehaviour { | |
public GameObject prefab; | |
GameObject instance; | |
void Start () { | |
this.instance = Instantiate (prefab) as GameObject; | |
} | |
void Update () { | |
this.instance.transform.Translate (0, 0.08f, 0); | |
} | |
} |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class MoleGenerator : MonoBehaviour { | |
Mole mole1; | |
Mole mole2; | |
Mole mole3; | |
void Start () { | |
this.mole1 = GetComponent<Mole>() as Mole; | |
mole1.transform.position = new Vector3 (-6.02f, -3.51f, 0); | |
this.mole2 = GetComponent<Mole>() as Mole; | |
mole2.transform.position = new Vector3 (0.2f, -4.31f, 0); | |
this.mole3 = GetComponent<Mole>() as Mole; | |
mole3.transform.position = new Vector3 (6.13f, -2.16f, 0); | |
} | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment