public void finish(Sign.TYPE sign) { Debug.Log("Finish sign = " + sign); finished = true; finishSign = sign; MusicController.current.playVictorySound(); PopupController.current.openPopup(finishPrefab); }
public void playSignSound(Sign.TYPE sign) { if (isSoundOn) { if (sign == Sign.TYPE.O) { soundOSource.Play(); } else if (sign == Sign.TYPE.PLUS) { soundPlusSource.Play(); } } }
// Use this for initialization void Start() { Sign.TYPE turn = LevelController.current.finishSign; if (turn == Sign.TYPE.O) { hero.sprite2D = oHeroSprite; sign.sprite2D = oSprite; } else { hero.sprite2D = plusHeroSprite; sign.sprite2D = plusSprite; } }
public void move() { if (this.turn == Sign.TYPE.O) { this.turn = Sign.TYPE.PLUS; disable(heroO); enable(heroPlus); } else if (this.turn == Sign.TYPE.PLUS) { this.turn = Sign.TYPE.O; disable(heroPlus); enable(heroO); } }
public void _onClick() { if (!LevelController.current.isFinished() && !this.isFilled() && parent.isActive()) { fill(LevelController.current.getTurn()); Sign.TYPE res = parent.isFinished(); if (res != Sign.TYPE.NONE) { LevelController.current.finish(res); return; } LevelController.current.move(); LevelController.current.fieldBig.activateField(this.index); } }
public void fill(Sign.TYPE signType) { GameObject sign = null; if (signType == Sign.TYPE.O) { sign = GameObject.Instantiate(ObjectFactory.getInstance().signOPrefab); } else if (signType == Sign.TYPE.PLUS) { sign = GameObject.Instantiate(ObjectFactory.getInstance().signPlusPrefab); } Vector3 pos = this.transform.position; pos.z -= 1; sign.transform.GetComponent <Sign> ().Initialize(signType); sign.transform.localPosition = pos; MusicController.current.playSignSound(signType); this.mySign = signType; }
void Start() { this.mySign = Sign.TYPE.NONE; }
// Use this for initialization void Start() { Debug.Log("Started"); this.turn = Sign.TYPE.PLUS; disable(heroO); }