add シーンリロード(デバッグ) fixポイント追加処理
This commit is contained in:
parent
aa08a62cdc
commit
87f562552f
|
|
@ -1,6 +1,7 @@
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using System;
|
using System;
|
||||||
using UniRx;
|
using UniRx;
|
||||||
|
using UniRx.Triggers;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace MyGame.Scenes.MiniGame.Scripts
|
namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
|
|
@ -39,7 +40,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
lineRendererFront.endColor = Color.green;
|
lineRendererFront.endColor = Color.green;
|
||||||
|
|
||||||
var boundsSize = character.GetComponent<Collider2D>()?.bounds.size ?? default;
|
var boundsSize = character.GetComponent<Collider2D>()?.bounds.size ?? default;
|
||||||
var centerOffset = new Vector3(-boundsSize.x / 2, -boundsSize.y / 2);
|
var centerOffset = new Vector3(-boundsSize.x / 2, boundsSize.y / 2);
|
||||||
var frontOffset = new Vector3(boundsSize.x / 2, -boundsSize.y / 2);
|
var frontOffset = new Vector3(boundsSize.x / 2, -boundsSize.y / 2);
|
||||||
|
|
||||||
lineRendererCenter.SetPosition(0, character.position + centerOffset);
|
lineRendererCenter.SetPosition(0, character.position + centerOffset);
|
||||||
|
|
@ -53,6 +54,13 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
lineRendererFront.positionCount++;
|
lineRendererFront.positionCount++;
|
||||||
lineRendererFront.SetPosition(lineRendererFront.positionCount-1, character.position + frontOffset);
|
lineRendererFront.SetPosition(lineRendererFront.positionCount-1, character.position + frontOffset);
|
||||||
}).AddTo(this);
|
}).AddTo(this);
|
||||||
|
|
||||||
|
this.UpdateAsObservable()
|
||||||
|
.Where(_ => Input.GetKeyDown(KeyCode.R))
|
||||||
|
.Subscribe(_ =>
|
||||||
|
{
|
||||||
|
UnityEngine.SceneManagement.SceneManager.LoadScene("MiniGame");
|
||||||
|
}).AddTo(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
switch (item.ItemType)
|
switch (item.ItemType)
|
||||||
{
|
{
|
||||||
case StageItem.Type.Item1:
|
case StageItem.Type.Item1:
|
||||||
headerView.AddCount();
|
headerView.AddCount(item.Point);
|
||||||
break;
|
break;
|
||||||
case StageItem.Type.Obstacle:
|
case StageItem.Type.Obstacle:
|
||||||
player.Hit();
|
player.Hit();
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ namespace MyGame.Scenes.MiniGame.Scripts
|
||||||
timeCount.Value = 0;
|
timeCount.Value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddCount()
|
public void AddCount(int value)
|
||||||
{
|
{
|
||||||
itemCount.Value++;
|
itemCount.Value += value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeTimeCount(float newTime)
|
public void ChangeTimeCount(float newTime)
|
||||||
|
|
|
||||||
|
|
@ -134,4 +134,7 @@ EditorBuildSettings:
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity
|
path: Assets/MyGame/Scenes/marketing/CustomizeExplanation.unity
|
||||||
guid: dd7c837547bf89f489bc36b6a2ebbca4
|
guid: dd7c837547bf89f489bc36b6a2ebbca4
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/MyGame/Scenes/MiniGame/MiniGame.unity
|
||||||
|
guid: c21a0a611342d4e4b90e83df43aa3e5e
|
||||||
m_configObjects: {}
|
m_configObjects: {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue