improve column behaviour

This commit is contained in:
Chikashi Miyama 2019-10-08 22:31:27 +02:00
parent 6215653edf
commit 53d7b5c498
2 changed files with 8 additions and 5 deletions

View file

@ -267,7 +267,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 684460085} m_GameObject: {fileID: 684460085}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.02, y: 1, z: -7.01} m_LocalPosition: {x: -1.21, y: -2.11, z: -9.27}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}

View file

@ -4,16 +4,19 @@ namespace cylvester
{ {
public class ConstructionColumnBehaviour : MonoBehaviour public class ConstructionColumnBehaviour : MonoBehaviour
{ {
private Vector3 direction_; private int frameCount_;
private void Start() private void Start()
{ {
direction_ = new Vector3(Random.Range(-1.0f, 1.0f), 0f, Random.Range(-10.0f, 10.0f)); transform.position = new Vector3(Random.Range(-5.0f, 5.0f), 0f, Random.Range(-5.0f, 5.0f));
} }
private void Update() private void Update()
{ {
frameCount_++;
if(frameCount_ == 60)
Destroy(this.gameObject);
} }
} }
} }