Exemplo n.º 1
0
    public void finish(Sign.TYPE sign)
    {
        Debug.Log("Finish sign = " + sign);
        finished   = true;
        finishSign = sign;

        MusicController.current.playVictorySound();
        PopupController.current.openPopup(finishPrefab);
    }
Exemplo n.º 2
0
 public void playSignSound(Sign.TYPE sign)
 {
     if (isSoundOn)
     {
         if (sign == Sign.TYPE.O)
         {
             soundOSource.Play();
         }
         else if (sign == Sign.TYPE.PLUS)
         {
             soundPlusSource.Play();
         }
     }
 }
Exemplo n.º 3
0
 // 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;
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
    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);
        }
    }
Exemplo n.º 6
0
    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;
    }
Exemplo n.º 7
0
 void Start()
 {
     this.mySign = Sign.TYPE.NONE;
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("Started");
     this.turn = Sign.TYPE.PLUS;
     disable(heroO);
 }