Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pjc0247
Last active August 21, 2018 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjc0247/05b34360a664d7f85f6a247990112a5f to your computer and use it in GitHub Desktop.
Save pjc0247/05b34360a664d7f85f6a247990112a5f to your computer and use it in GitHub Desktop.
class MainScript : MonoBehaviour {
public static MainScript instance;
void Awake() {
instance = this;
}
public void OnSelectChamp(Champ champ) {
// ignore if state is not a `picking`
if (state != "PICKING_CHAMPS") return;
// write your code here
}
}
class Champ : MonoBehaviour {
public void UseAbility() {
SendMessage("_UseAbility");
}
void OnMouseDown() {
MainScript.instance.OnSelectChamp(this);
}
}
class BoostAbility : MonoBehaviour {
public void _UseAbility() {
/* Ability codes here */
}
}
class DeboostAbility : MonoBehaviour {
public int amount = 5;
public void _UseAbility() {
/* Ability codes here */
Referee.instance.opponent.Deboost(amount);
}
}
class Referee : Mono {
public static Referee instance;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment