Skip to content

Instantly share code, notes, and snippets.

@monry
Forked from komagata/Mole.cs
Last active December 20, 2017 06:42
Show Gist options
  • Save monry/9638696349dd76436d02dfe877541822 to your computer and use it in GitHub Desktop.
Save monry/9638696349dd76436d02dfe877541822 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mole : MonoBehaviour {
void Start () {
}
void Update () {
this.transform.Translate (0, 0.08f, 0);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoleGenerator : MonoBehaviour {
Mole mole1;
Mole mole2;
Mole mole3;
public GameObject molePrefab;
void Start () {
this.mole1 = Instantiate(this.molePrefab).GetComponent<Mole>();
mole1.transform.position = new Vector3 (-6.02f, -3.51f, 0);
this.mole2 = Instantiate(this.molePrefab).GetComponent<Mole>();
mole2.transform.position = new Vector3 (0.2f, -4.31f, 0);
this.mole3 = Instantiate(this.molePrefab).GetComponent<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