Created
July 27, 2018 14:41
-
-
Save 11/978bfbd5094ef69a8628b1fee2de91c0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ExampleState : IState { | |
private AudioSource sound; | |
private AudioClip shootSound; | |
private GameObject object; | |
public void Init(){ | |
sound = GetComponent<AudioSource>(); | |
gb = new GameObject(); | |
} | |
public void Update(){ | |
// update logic | |
if(gb.position.x > 10){ | |
source.PlayOneShot(shootSound, 5); | |
} | |
} | |
public void Render(){ | |
// render game object | |
gb.render() | |
} | |
public void Dispose(){ | |
// When we're doing, we can just throw away this game object | |
gb.remove(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment