コード例 #1
0
 public void setBlack()
 {
     state = BWState.Black;
     blackField.SetActive(true);
     whiteField.SetActive(false);
 }
コード例 #2
0
 public void SetWhite()
 {
     state = BWState.White;
     blackField.SetActive(false);
     whiteField.SetActive(true);
 }
コード例 #3
0
    void change()
    {
        Debug.Log("change " + state.ToString());
        if (state == BWState.White)
        {
            state         = BWState.MidBlack;
            changeTimeTem = 0;

            coverBroad.color = new Color(1f, 1f, 1f, 0f);
            HOTween.To(coverBroad
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(1f, 1f, 1f, 1f), false)
                       .OnComplete(setBlack)
                       );
            HOTween.To(coverBroad
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(1f, 1f, 1f, 0f), false)
                       .Delay(changeDuration / 2 + changeStop)
                       );
            coverWord.SetSprite("word" + UnityEngine.Random.Range(1, 5).ToString());
            if (UnityEngine.Random.Range(0, 1f) < 0.5f)
            {
                coverWord.transform.eulerAngles += new Vector3(0, 0, 180f);
            }
            coverWord.color = new Color(0f, 0, 0, 0f);
            HOTween.To(coverWord
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(0f, 0f, 0f, 1f), false)

                       );
            HOTween.To(coverWord
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(0f, 0f, 0f, 0f), false)
                       .Delay(changeDuration / 2 + changeStop)
                       );
        }
        else if (state == BWState.Black)
        {
            state         = BWState.MidWhite;
            changeTimeTem = 0;

            coverBroad.color = new Color(0f, 0f, 0f, 0f);
            HOTween.To(coverBroad
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(0f, 0f, 0f, 1f), false)
                       .OnComplete(SetWhite)
                       );
            HOTween.To(coverBroad
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(0f, 0f, 0f, 0f), false)
                       .Delay(changeDuration / 2 + changeStop)

                       );
            coverWord.color = new Color(1f, 1f, 1f, 0f);
            coverWord.SetSprite("word" + UnityEngine.Random.Range(1, 5).ToString());
            if (UnityEngine.Random.Range(0, 1f) < 0.5f)
            {
                coverWord.transform.eulerAngles += new Vector3(0, 0, 180f);
            }
            HOTween.To(coverWord
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(1f, 1f, 1f, 1f), false)

                       );
            HOTween.To(coverWord
                       , changeDuration / 2
                       , new TweenParms().Prop("color",
                                               new Color(1f, 1f, 1f, 0f), false)
                       .Delay(changeDuration / 2 + changeStop)
                       );
        }
    }
コード例 #4
0
ファイル: Game.cs プロジェクト: AtwoodDeng/GGJ2015
	public void setBlack()
	{
		state = BWState.Black;
		blackField.SetActive(true);
		whiteField.SetActive(false);
	}
コード例 #5
0
ファイル: Game.cs プロジェクト: AtwoodDeng/GGJ2015
	public void SetWhite()
	{
		state = BWState.White;
		blackField.SetActive(false);
		whiteField.SetActive(true);
	}
コード例 #6
0
ファイル: Game.cs プロジェクト: AtwoodDeng/GGJ2015
	void change () {
		Debug.Log( "change " + state.ToString() );
		if ( state == BWState.White )
		{
			state = BWState.MidBlack;
			changeTimeTem = 0;

			coverBroad.color = new Color( 1f , 1f , 1f , 0f );
			HOTween.To( coverBroad
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			           new Color( 1f , 1f , 1f , 1f ) , false )
			           .OnComplete( setBlack )
			           );
			HOTween.To( coverBroad
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 1f , 1f , 1f , 0f ) , false )
			           .Delay( changeDuration / 2 + changeStop ) 
			           );
			coverWord.SetSprite( "word" + UnityEngine.Random.Range( 1 , 5).ToString() );
			if ( UnityEngine.Random.Range( 0 , 1f ) < 0.5f )
				coverWord.transform.eulerAngles += new Vector3( 0 , 0 , 180f );
			coverWord.color = new Color( 0f , 0 , 0 , 0f );
			HOTween.To( coverWord
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 0f , 0f , 0f , 1f ) , false )

			           );
			HOTween.To( coverWord
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 0f , 0f , 0f , 0f ) , false )
			           .Delay( changeDuration / 2 + changeStop ) 
			           );
			           
		}else if ( state == BWState.Black )
		{
			state = BWState.MidWhite;
			changeTimeTem = 0;

			coverBroad.color = new Color( 0f , 0f , 0f , 0f );
			HOTween.To( coverBroad
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 0f , 0f , 0f , 1f ) , false )
			           .OnComplete( SetWhite )
			           );
			HOTween.To( coverBroad
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 0f , 0f , 0f , 0f ) , false )
			           .Delay( changeDuration / 2 + changeStop )

			           );
			coverWord.color = new Color( 1f ,1f ,1f ,0f );
			coverWord.SetSprite( "word" + UnityEngine.Random.Range( 1 , 5).ToString() );
			if ( UnityEngine.Random.Range( 0 , 1f ) < 0.5f )
				coverWord.transform.eulerAngles += new Vector3( 0 , 0 , 180f );
			HOTween.To( coverWord
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 1f , 1f , 1f , 1f ) , false )

			           );
			HOTween.To( coverWord
			           , changeDuration /2 
			           , new TweenParms().Prop( "color" ,
			                        new Color( 1f , 1f , 1f , 0f ) , false )
			           .Delay( changeDuration / 2 + changeStop ) 
			           );
		}
	}