Пример #1
0
	// Update is called once per frame
	void Update () {

		if (!IsMarkerEmited)
		{
			GameObject emitobj = Instantiate( goalEnemy .gameObject , transform.position , Quaternion .Euler( new Vector3( 0 , 180 , 0 ) ) ) as GameObject;
			EmitEnemy = emitobj.GetComponent<GoalEnemy>();
			EmitMarker = staticScript .staticMarkerEmitter .Emit( GoalMarker.gameObject , new Vector2( 0 , 0 ) , new Vector3( 0 , 0 , 0 ) , EmitEnemy , true );
			EmitMarker .LoopSetting();
			EmitMarker .IsCanSwordAttackDisable();
			IsMarkerEmited = true;
		}
		if (EmitEnemy != null)
			EmitEnemy .transform .position = staticScript .frontMoverManager .GetPosFromStep( staticScript .frontMoverManager .GoalPos ) + AdjustGoalEnemy;


		staticScript .goalMain.transform.position = staticScript .frontMoverManager.GetPosFromStep( staticScript .frontMoverManager.GoalPos);

		if (staticScript .frontMoverManager .IsGoal && EmitMarker != null)
		{
			EmitMarker .IsCanSwordAttackEneble();
		}
		if(EmitMarker== null)
		{
			if (!IsRun)
			{
				staticScript .push .enabled = false;
				staticScript .timer .Stop();
				staticScript .score .Stop();
				staticScript .resultData .Stop();

				staticScript .actionTymingManager .Disable();
				//staticScript .backMusic .Stop();

				staticScript .topEnemyManager .Stop();

				staticScript .rhythmManager .Stop();

				foreach (Button button in buttons)
				{
					button .enabled = false;
				}

			}
			IsRun = true;
		}
		if(IsRun)
		{
            time += Time.unscaledDeltaTime;
			if(/*uIAlpha <= .0f &&*/ !CameraChanged)
			{
                goalCamera.transform.position = Camera.main.transform.position;
				AfterRot = Camera.main.transform.rotation;
                Camera.main.enabled = false;
                goalCamera.enabled = true;
                //staticScript.goalMain.enabled = true;
				CameraChanged = true;
			}
			goalCamera .transform .forward = ( EmitEnemy .EmitFireWork .transform .position - goalCamera.transform .position ) .normalized;

			if(FireWorkCount  >= 1)
			{
				if(!CameraRotStart)
				{
					BeforeRot = goalCamera .transform .rotation;
					CameraRotStart = true;
					staticScript .goalMain .Osyou .SetActive( true );
					Destroy( EmitEnemy .gameObject );
				}
				else
				{
					RotTime += Time .deltaTime;
					float work = CameraCurve.Evaluate(RotTime);

					if (work > 1.0f)
						work = 1.0f;
					goalCamera .transform .rotation = Quaternion .Slerp( BeforeRot , AfterRot , work );

					if(work == 1.0f)
					{
						staticScript .goalMain .enabled = true;
						if(!Se)
						{
							Instantiate( GoalTaiko .gameObject );
							Se = true;
						}
					}
				}
			}

		}
			uIAlpha = RendererAlpha .Evaluate( time );	
		foreach (CanvasRenderer renderer in renderers)
		{
			renderer .SetAlpha( renderer .GetAlpha() * uIAlpha );
		}
	}
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (!IsMarkerEmited)
        {
            GameObject emitobj = Instantiate(goalEnemy.gameObject, transform.position, Quaternion.Euler(new Vector3(0, 180, 0))) as GameObject;
            EmitEnemy  = emitobj.GetComponent <GoalEnemy>();
            EmitMarker = staticScript.staticMarkerEmitter.Emit(GoalMarker.gameObject, new Vector2(0, 0), new Vector3(0, 0, 0), EmitEnemy, true);
            EmitMarker.LoopSetting();
            EmitMarker.IsCanSwordAttackDisable();
            IsMarkerEmited = true;
        }
        if (EmitEnemy != null)
        {
            EmitEnemy.transform.position = staticScript.frontMoverManager.GetPosFromStep(staticScript.frontMoverManager.GoalPos) + AdjustGoalEnemy;
        }


        staticScript.goalMain.transform.position = staticScript.frontMoverManager.GetPosFromStep(staticScript.frontMoverManager.GoalPos);

        if (staticScript.frontMoverManager.IsGoal && EmitMarker != null)
        {
            EmitMarker.IsCanSwordAttackEneble();
        }
        if (EmitMarker == null)
        {
            if (!IsRun)
            {
                staticScript.push.enabled = false;
                staticScript.timer.Stop();
                staticScript.score.Stop();
                staticScript.resultData.Stop();

                staticScript.actionTymingManager.Disable();
                //staticScript .backMusic .Stop();

                staticScript.topEnemyManager.Stop();

                staticScript.rhythmManager.Stop();

                foreach (Button button in buttons)
                {
                    button.enabled = false;
                }
            }
            IsRun = true;
        }
        if (IsRun)
        {
            time += Time.unscaledDeltaTime;
            if (/*uIAlpha <= .0f &&*/ !CameraChanged)
            {
                goalCamera.transform.position = Camera.main.transform.position;
                AfterRot            = Camera.main.transform.rotation;
                Camera.main.enabled = false;
                goalCamera.enabled  = true;
                //staticScript.goalMain.enabled = true;
                CameraChanged = true;
            }
            goalCamera.transform.forward = (EmitEnemy.EmitFireWork.transform.position - goalCamera.transform.position).normalized;

            if (FireWorkCount >= 1)
            {
                if (!CameraRotStart)
                {
                    BeforeRot      = goalCamera.transform.rotation;
                    CameraRotStart = true;
                    staticScript.goalMain.Osyou.SetActive(true);
                    Destroy(EmitEnemy.gameObject);
                }
                else
                {
                    RotTime += Time.deltaTime;
                    float work = CameraCurve.Evaluate(RotTime);

                    if (work > 1.0f)
                    {
                        work = 1.0f;
                    }
                    goalCamera.transform.rotation = Quaternion.Slerp(BeforeRot, AfterRot, work);

                    if (work == 1.0f)
                    {
                        staticScript.goalMain.enabled = true;
                        if (!Se)
                        {
                            Instantiate(GoalTaiko.gameObject);
                            Se = true;
                        }
                    }
                }
            }
        }
        uIAlpha = RendererAlpha.Evaluate(time);
        foreach (CanvasRenderer renderer in renderers)
        {
            renderer.SetAlpha(renderer.GetAlpha() * uIAlpha);
        }
    }