using UnityEngine;
using System.Collections;
public class playerProperties1501 : MonoBehaviour {
public enum PlayerState
{
MarioDead = 0,
MarioSmall = 1,
MarioLarge = 2,
MarioFire = 3
}
public PlayerState MarioState = PlayerState.MarioSmall;
public int lives = 3;
public int key = 0;
public int coins = 0;
public GameObject projectileFire;
public Transform projectileSocketRight;
public Transform projectileSocketLeft;
public Material materialMarioStandard;
public Material materialMarioFire;
public bool changeMario = false;
public bool hasFire = false;
private int coinLife = 20;
private bool canShoot = false;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void AddKeys(int numKey)
{
key += numKey;
}
public void AddCoins(int numCoin)
{
coins += numCoin;
}
}
using UnityEngine;
using System.Collections;
[AddComponentMenu("Component/csk0123/Actor/Player Properties Script")]
public class playerProperties1502 : MonoBehaviour {
public enum PlayerState
{
MarioDead = 0,
MarioSmall = 1,
MarioLarge = 2,
MarioFire = 3
}
public PlayerState MarioState = PlayerState.MarioSmall;
public int lives = 3;
public int key = 0;
public int coins = 0;
public GameObject projectileFire;
public Transform projectileSocketRight;
public Transform projectileSocketLeft;
public Material materialMarioStandard;
public Material materialMarioFire;
public bool changeMario = false;
public bool hasFire = false;
private int coinLife = 20;
private bool canShoot = false;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
SetPlayerState();
}
public void AddKeys(int numKey)
{
key += numKey;
}
public void AddCoins(int numCoin)
{
coins += numCoin;
}
void SetPlayerState()
{
playerControls playerControls = GetComponent<playerControls>();
CharacterController controller = GetComponent<CharacterController>();
switch (MarioState)
{
case PlayerState.MarioSmall:
print("mario small");
break;
case PlayerState.MarioLarge:
print("mario large");
break;
case PlayerState.MarioFire:
print("mario fire");
break;
case PlayerState.MarioDead:
print("mario dead");
break;
}
}
}
using UnityEngine;
using System.Collections;
[AddComponentMenu("Component/csk0123/Actor/Player Properties Script")]
public class playerProperties1601 : MonoBehaviour {
public enum PlayerState
{
MarioDead = 0,
MarioSmall = 1,
MarioLarge = 2,
MarioFire = 3
}
public PlayerState MarioState = PlayerState.MarioSmall;
public int lives = 3;
public int key = 0;
public int coins = 0;
public GameObject projectileFire;
public Transform projectileSocketRight;
public Transform projectileSocketLeft;
public Material materialMarioStandard;
public Material materialMarioFire;
public bool changeMario = false;
public bool hasFire = false; // can shot ÇÒ Œö ÀÖ°Ô µÊ
private int coinLife = 20;
private bool canShoot = false;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (changeMario)
{
SetPlayerState();
}
}
public void AddKeys(int numKey)
{
key = numKey;
}
public void AddCoins(int numCoin)
{
coins += numCoin;
}
void SetPlayerState()
{
playerControls playerControls = GetComponent<playerControls>();
CharacterController controller = GetComponent<CharacterController>();
switch (MarioState)
{
case PlayerState.MarioSmall:
print("mario small");
transform.localScale = new Vector3(1.0F, 0.75F, 1.0F);
break;
case PlayerState.MarioLarge:
print("mario large");
transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
break;
case PlayerState.MarioFire:
print("mario fire");
transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
break;
case PlayerState.MarioDead:
print("mario dead");
//transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
break;
}
}
}
using UnityEngine;
using System.Collections;
[AddComponentMenu("Component/csk0123/Actor/Player Properties Script")]
public class playerProperties1602 : MonoBehaviour {
public enum PlayerState
{
MarioDead = 0,
MarioSmall = 1,
MarioLarge = 2,
MarioFire = 3
}
public PlayerState MarioState = PlayerState.MarioSmall;
public int lives = 3;
public int key = 0;
public int coins = 0;
public GameObject projectileFire;
public Transform projectileSocketRight;
public Transform projectileSocketLeft;
public Material materialMarioStandard;
public Material materialMarioFire;
public bool changeMario = false;
public bool hasFire = false; // can shot ÇÒ Œö ÀÖ°Ô µÊ
private int coinLife = 20;
private bool canShoot = false;
private playerControls PlayerControls;
// Use this for initialization
void Start () {
PlayerControls = GetComponent<playerControls>();
}
// Update is called once per frame
void Update () {
if (changeMario)
{
SetPlayerState();
}
if (canShoot)
{
GameObject Clone;
if (Input.GetButtonDown("Fire1") && projectileFire && PlayerControls.moveDirection == 0)
{
Clone = (GameObject)Instantiate(projectileFire, projectileSocketLeft.transform.position, transform.rotation);
Clone.rigidbody.AddForce(-90, 0, 0);
}
if (Input.GetButtonDown("Fire1") && projectileFire && PlayerControls.moveDirection == 1)
{
Clone = (GameObject)Instantiate(projectileFire, projectileSocketRight.transform.position, transform.rotation);
Clone.rigidbody.AddForce(90, 0, 0);
}
}
}
public void AddKeys(int numKey)
{
key = numKey;
}
public void AddCoins(int numCoin)
{
coins += numCoin;
}
void SetPlayerState()
{
playerControls playerControls = GetComponent<playerControls>();
CharacterController controller = GetComponent<CharacterController>();
switch (MarioState)
{
case PlayerState.MarioSmall:
print("mario small");
transform.localScale = new Vector3(1.0F, 0.75F, 1.0F);
canShoot = false;
break;
case PlayerState.MarioLarge:
print("mario large");
transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
canShoot = false;
break;
case PlayerState.MarioFire:
print("mario fire");
transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
canShoot = true;
break;
case PlayerState.MarioDead:
print("mario dead");
//transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
//canShoot = false;
break;
}
}
}
Update()에서 AddForce()함수를 처리하고 있으나, 물성과 관련된 부분은 되도록 FixedUpdat()에서 처리할 수 있도록 하는 것이 좋음(특히 매 프레임마다 AddForce가 호출되는 경우)
using UnityEngine;
using System.Collections;
[AddComponentMenu("Component/csk0123/Actor/Player Properties Script")]
public class playerProperties1603 : MonoBehaviour {
public enum PlayerState
{
MarioDead = 0,
MarioSmall = 1,
MarioLarge = 2,
MarioFire = 3
}
public PlayerState MarioState = PlayerState.MarioSmall;
public int lives = 3;
public int key = 0;
public int coins = 0;
public GameObject projectileFire;
public Transform projectileSocketRight;
public Transform projectileSocketLeft;
public Material materialMarioStandard;
public Material materialMarioFire;
public bool changeMario = false;
public bool hasFire = false; // can shot ÇÒ Œö ÀÖ°Ô µÊ
private int coinLife = 20;
private bool canShoot = false;
private playerControls PlayerControls;
// Use this for initialization
void Start () {
PlayerControls = GetComponent<playerControls>();
}
// Update is called once per frame
void Update () {
if (changeMario)
{
SetPlayerState();
}
if (canShoot)
{
GameObject Clone;
if (Input.GetButtonDown("Fire1") && projectileFire && PlayerControls.moveDirection == 0)
{
Clone = (GameObject)Instantiate(projectileFire, projectileSocketLeft.transform.position, transform.rotation);
Clone.rigidbody.AddForce(-90, 0, 0);
// print("AddForect");
}
if (Input.GetButtonDown("Fire1") && projectileFire && PlayerControls.moveDirection == 1)
{
Clone = (GameObject)Instantiate(projectileFire, projectileSocketRight.transform.position, transform.rotation);
Clone.rigidbody.AddForce(90, 0, 0);
// print("AddForect");
}
}
}
public void AddKeys(int numKey)
{
key = numKey;
}
public void AddCoins(int numCoin)
{
coins += numCoin;
}
void SetPlayerState()
{
playerControls playerControls = GetComponent<playerControls>();
CharacterController controller = GetComponent<CharacterController>();
switch (MarioState)
{
case PlayerState.MarioSmall:
playerControls.gravity = 0.0F;
transform.Translate(0F, 0.2F, 0F);
transform.localScale = new Vector3(1.0F, 0.75F, 1.0F);
controller.height = 0.45F;
transform.renderer.material = materialMarioStandard;
playerControls.gravity = 20.0F;
canShoot = false;
changeMario = false;
break;
case PlayerState.MarioLarge:
playerControls.gravity = 0.0F;
transform.Translate(0F, 0.2F, 0F);
transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
transform.renderer.material = materialMarioStandard;
playerControls.gravity = 20.0F;
canShoot = false;
changeMario = false;
break;
case PlayerState.MarioFire:
playerControls.gravity = 0.0F;
transform.Translate(0F, 0.2F, 0F);
transform.localScale = new Vector3(1.0F, 1.0F, 1.0F);
transform.renderer.material = materialMarioFire;
playerControls.gravity = 20.0F;
canShoot = true;
changeMario = false;
break;
case PlayerState.MarioDead:
Destroy(gameObject);
changeMario = false;
break;
}
}
}
using UnityEngine;
using System.Collections;
public class spawnSaveSetup : MonoBehaviour {
public Transform startPoint;
public AudioClip soundDie;
private float soundRate = 0.0f;
private float soundDelay = 0.0f;
private Vector3 curSavePos;
IEnumerator PlaySound(AudioClip soundName, float soundDelay)
{
if (!audio.isPlaying && Time.time > soundRate)
{
// Debug.Log(soundRate);
soundRate = Time.time + soundDelay;
audio.clip = soundName;
audio.Play();
yield return new WaitForSeconds(audio.clip.length);
}
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "savePoint")
{
curSavePos = transform.position;
}
if (other.tag == "killbox")
{
StartCoroutine(PlaySound(soundDie, 0));
transform.position = curSavePos;
}
}
// Use this for initialization
void Start () {
if (startPoint != null)
{
transform.position = startPoint.position;
}
}
// Update is called once per frame
void Update () {
}
}
using UnityEngine;
using System.Collections;
public class cameraSmoothFollow2D2001 : MonoBehaviour {
public GameObject cameraTarget;
public GameObject player;
public float smoothTime = 0.1F;
public bool cameraFollowX = true;
public bool cameraFollowY = true;
public bool cameraFollowHeight = false;
public float cameraHeight = 2.5F;
public Vector2 velocity = Vector2.zero;
private Transform thisTransform;
// Use this for initialization
void Start()
{
thisTransform = transform;
}
// Update is called once per frame
void Update()
{
if (cameraFollowX)
{
}
if (cameraFollowY)
{
}
if (!cameraFollowY && cameraFollowHeight)
{
}
}
}
using UnityEngine;
using System.Collections;
public class cameraSmoothFollow2D2002 : MonoBehaviour {
public GameObject cameraTarget;
public GameObject player;
public float smoothTime = 0.1F;
public bool cameraFollowX = true;
public bool cameraFollowY = true;
public bool cameraFollowHeight = false;
public float cameraHeight = 2.5F;
public Vector2 velocity = Vector2.zero;
private Transform thisTransform;
// Use this for initialization
void Start()
{
thisTransform = transform;
}
// Update is called once per frame
void Update()
{
if (cameraFollowX)
{
float x = Mathf.SmoothDamp(thisTransform.position.x, cameraTarget.transform.position.x, ref velocity.x, smoothTime);
thisTransform.position = new Vector3(x, thisTransform.position.y, thisTransform.position.z);
}
if (cameraFollowY)
{
float y = Mathf.SmoothDamp(thisTransform.position.y, cameraTarget.transform.position.y, ref velocity.y, smoothTime);
thisTransform.position = new Vector3(thisTransform.position.x, y, thisTransform.position.z);
}
if (!cameraFollowY && cameraFollowHeight)
{
}
}
}
using UnityEngine;
using System.Collections;
public class cameraSmoothFollow2D2003 : MonoBehaviour {
public GameObject cameraTarget;
public GameObject player;
public float smoothTime = 0.1F;
public bool cameraFollowX = true;
public bool cameraFollowY = true;
public bool cameraFollowHeight = false;
public float cameraHeight = 2.5F;
public Vector2 velocity = Vector2.zero;
private Transform thisTransform;
// Use this for initialization
void Start()
{
thisTransform = transform;
}
// Update is called once per frame
void Update()
{
if (cameraFollowX)
{
float x = Mathf.SmoothDamp(thisTransform.position.x, cameraTarget.transform.position.x, ref velocity.x, smoothTime);
thisTransform.position = new Vector3(x, thisTransform.position.y, thisTransform.position.z);
}
if (cameraFollowY)
{
float y = Mathf.SmoothDamp(thisTransform.position.y, cameraTarget.transform.position.y, ref velocity.y, smoothTime);
thisTransform.position = new Vector3(thisTransform.position.x, y, thisTransform.position.z);
}
if (!cameraFollowY && cameraFollowHeight)
{
thisTransform.position = new Vector3(thisTransform.position.x, cameraHeight, thisTransform.position.z);
}
}
}
using UnityEngine;
using System.Collections;
public class cameraSmoothFollow2D2101 : MonoBehaviour {
public GameObject cameraTarget;
public GameObject player;
public float smoothTime = 0.1F;
public bool cameraFollowX = true;
public bool cameraFollowY = true;
public bool cameraFollowHeight = false;
public float cameraHeight = 2.5F;
public bool cameraZoom = false;
public float cameraZoomMax = 4.0F;
public float cameraZoomMin = 2.5F;
public float cameraZoomTime = 0.05F;
private float curPos = 0.0F;
private float playerJumpHeight = 0.0F;
public Vector2 velocity = Vector2.zero;
private Transform thisTransform;
public Vector3 tempPos;
// Use this for initialization
void Start()
{
thisTransform = transform;
tempPos = thisTransform.position;
}
// Update is called once per frame
void Update()
{
if (cameraFollowX)
{
tempPos.x = Mathf.SmoothDamp(thisTransform.position.x, cameraTarget.transform.position.x, ref velocity.x, smoothTime);
thisTransform.position = tempPos; // new Vector3(x, thisTransform.position.y, thisTransform.position.z);
}
if (cameraFollowY)
{
tempPos.y = Mathf.SmoothDamp(thisTransform.position.y, cameraTarget.transform.position.y, ref velocity.y, smoothTime);
thisTransform.position = tempPos; // new Vector3(thisTransform.position.x, y, thisTransform.position.z);
}
if (!cameraFollowY && cameraFollowHeight)
{
tempPos.y = cameraHeight;
thisTransform.position = tempPos; // new Vector3(thisTransform.position.x, cameraHeight, thisTransform.position.z);
}
}
}
using UnityEngine;
using System.Collections;
public class playerControls2102 : MonoBehaviour {
public float walkSpeed = 1.5F;
public float runSpeed = 2.0F;
public float fallSpeed = 2.0F;
public float walkJump = 6.2F;
public float runJump = 9.0F;
public float crouchJump = 10.0F;
public float gravity = 20.0F;
public float startPos = 0.0F;
public int moveDirection = 1;
public Transform particleJump;
public AudioClip soundJump;
public AudioClip soundCrouchJump;
public float soundRate = 0.0f;
private float soundDelay = 0.0f;
public Vector3 velocity = Vector3.zero;
private bool jumpEnable = false;
private bool runJumpEnable = false;
private bool crouchJumpEnable = false;
private float afterHitForceDown = 1.0F;
private aniSprite aniSpr;
private CharacterController controller;
// Use this for initialization
void Start()
{
aniSpr = GetComponent<aniSprite>();
controller = GetComponent<CharacterController>();
}
public IEnumerator PlaySound(AudioClip soundName, float soundDelay)
{
if (!audio.isPlaying && Time.time > soundRate)
{
// Debug.Log(soundRate);
soundRate = Time.time + soundDelay;
audio.clip = soundName;
audio.Play();
yield return new WaitForSeconds(audio.clip.length);
}
}
void Update()
{
Vector3 particlePlacement = new Vector3(transform.position.x, transform.position.y - 0.5F, transform.position.z);
if (controller.isGrounded)
{
jumpEnable = false;
runJumpEnable = false;
crouchJumpEnable = false;
// ÁÜÀÎ ÁÜŸÆ¿ô¿¡Œ »ç¿ëÇϱâ À§ÇØ...
startPos = transform.position.y; //P21
velocity = new Vector3(Input.GetAxis("Horizontal"), 0, 0); //Input.GetAxis("Vertical"));
if (velocity.x == 0 && moveDirection == 1)
{
aniSpr.aniPlay(16, 16, 0, 0, 16, 12);
}
if (velocity.x == 0 && moveDirection == 0)
{
aniSpr.aniPlay(16, 16, 0, 1, 16, 12);
}
if (velocity.x < 0)
{
velocity *= walkSpeed;
aniSpr.aniPlay(16, 16, 0, 3, 10, 15);
}
if (velocity.x > 0)
{
velocity *= walkSpeed;
aniSpr.aniPlay(16, 16, 0, 2, 10, 15);
}
if (velocity.x < 0 && Input.GetButton("Fire1"))
{
velocity *= runSpeed;
aniSpr.aniPlay(16, 16, 0, 5, 16, 24);
}
if (velocity.x > 0 && Input.GetButton("Fire1"))
{
velocity *= runSpeed;
aniSpr.aniPlay(16, 16, 0, 4, 16, 24);
}
if (velocity.x == 0 && Input.GetAxis("Vertical") < 0)
{
if (moveDirection == 0)
{
velocity.x = 0;
aniSpr.aniPlay(16, 16, 0, 9, 16, 24);
}
if (moveDirection == 1)
{
velocity.x = 0;
aniSpr.aniPlay(16, 16, 0, 8, 16, 24);
}
}
if (Input.GetButtonDown("Jump"))
{
if (Input.GetButton("Fire1"))
{
velocity.y = runJump;
Instantiate(particleJump, particlePlacement, transform.rotation);
runJumpEnable = true;
StartCoroutine(PlaySound(soundJump, 0));
}
else
{
if (velocity.x == 0 && Input.GetAxis("Vertical") < 0)
{
velocity.y = crouchJump;
Instantiate(particleJump, particlePlacement, transform.rotation);
crouchJumpEnable = true;
StartCoroutine(PlaySound(soundCrouchJump, 0));
}
else
{
velocity.y = walkJump;
Instantiate(particleJump, particlePlacement, transform.rotation);
jumpEnable = true;
StartCoroutine(PlaySound(soundJump, 0));
}
}
}
}
if (!controller.isGrounded)
{
velocity.x = Input.GetAxis("Horizontal");
if (Input.GetButtonUp("Jump")) // Á¡ÇÁ ŰžŠ ³õŽÂ Œø°£ Á¡ÇÁ ŸÈÇϰÔ
{
velocity.y = velocity.y - fallSpeed;
//print(" Jump Draw");
}
if (moveDirection == 0)
{
if (jumpEnable)
{
velocity.x *= walkSpeed;
aniSpr.aniPlay(16, 16, 11, 3, 4, 12);
}
if (runJumpEnable)
{
velocity.x *= runSpeed;
aniSpr.aniPlay(16, 16, 11, 3, 4, 12);
}
if (crouchJumpEnable)
{
velocity.x *= walkSpeed;
aniSpr.aniPlay(16, 16, 12, 11, 4, 12);
}
}
if (moveDirection == 1)
{
if (jumpEnable)
{
velocity.x *= walkSpeed;
aniSpr.aniPlay(16, 16, 11, 2, 4, 12);
}
if (runJumpEnable)
{
velocity.x *= runSpeed;
aniSpr.aniPlay(16, 16, 11, 2, 4, 12);
}
if (crouchJumpEnable)
{
velocity.x *= walkSpeed;
aniSpr.aniPlay(16, 16, 12, 10, 4, 12);
}
}
}
if (velocity.x < 0)
{
moveDirection = 0;
}
if (velocity.x > 0)
{
moveDirection = 1;
}
if (controller.collisionFlags == CollisionFlags.Above)
{
velocity.y = 0;
velocity.y -= afterHitForceDown;
}
velocity.y -= gravity * Time.deltaTime;
controller.Move(velocity * Time.deltaTime);
}
}
using UnityEngine;
using System.Collections;
public class cameraSmoothFollow2D2103 : MonoBehaviour {
public GameObject cameraTarget;
public GameObject player;
public float smoothTime = 0.1F;
public bool cameraFollowX = true;
public bool cameraFollowY = true;
public bool cameraFollowHeight = false;
public float cameraHeight = 2.5F;
public bool cameraZoom = false;
public float cameraZoomMax = 4.0F;
public float cameraZoomMin = 2.5F;
public float cameraZoomTime = 0.05F;
private float curPos = 0.0F;
private float playerJumpHeight = 0.0F;
public Vector2 velocity = Vector2.zero;
private Transform thisTransform;
public Vector3 tempPos;
playerControls playerControls;
// Use this for initialization
void Start()
{
thisTransform = transform;
tempPos = thisTransform.position;
playerControls = player.GetComponent<playerControls>();
}
// Update is called once per frame
void Update()
{
if (cameraFollowX)
{
tempPos.x = Mathf.SmoothDamp(thisTransform.position.x, cameraTarget.transform.position.x, ref velocity.x, smoothTime);
thisTransform.position = tempPos; // new Vector3(x, thisTransform.position.y, thisTransform.position.z);
}
if (cameraFollowY)
{
tempPos.y = Mathf.SmoothDamp(thisTransform.position.y, cameraTarget.transform.position.y, ref velocity.y, smoothTime);
thisTransform.position = tempPos; // new Vector3(thisTransform.position.x, y, thisTransform.position.z);
}
if (!cameraFollowY && cameraFollowHeight)
{
tempPos.y = cameraHeight;
thisTransform.position = tempPos; // new Vector3(thisTransform.position.x, cameraHeight, thisTransform.position.z);
}
if (cameraZoom)
{
curPos = player.transform.position.y;
playerJumpHeight = curPos - playerControls.startPos;
if (playerJumpHeight < 0) // ŸÆ·¡·Î ³»·Á°¡ŽÂ ÁßÀÌžé...
{
playerJumpHeight *= -1; // ŸçŒö·Î ¹Ù²ã ÁÖ±â À§ÇØ
}
if (playerJumpHeight > cameraZoomMax)
{
playerJumpHeight = cameraZoomMax;
}
this.camera.orthographicSize = Mathf.Lerp(this.camera.orthographicSize,
playerJumpHeight + cameraZoomMin, Time.time * cameraZoomTime);
}
}
}
using UnityEngine;
using System.Collections;
public class cameraBorderFollow2D : MonoBehaviour {
public GameObject cameraTarget;
public GameObject player;
public float cameraHeight = 1.0F;
public float smoothTime = 0.2F;
public float borderX = 2.0F;
public float borderY = 2.0F;
private Vector2 velocity;
private bool moveScreenRight = false;
private bool moveScreenLeft = false;
playerControls moveDir;
// Use this for initialization
void Start () {
cameraHeight = camera.transform.position.y;
moveDir = player.GetComponent<playerControls>();
}
// Update is called once per frame
void Update () {
if (cameraTarget.transform.position.x > camera.transform.position.x + borderX && moveDir.moveDirection == 1)
{
moveScreenRight = true;
}
if (moveScreenRight)
{
float temp = Mathf.SmoothDamp(camera.transform.position.x, camera.transform.position.x + borderX, ref velocity.y, smoothTime);
camera.transform.position = new Vector3(temp, camera.transform.position.y, camera.transform.position.z);
}
if (cameraTarget.transform.position.x < camera.transform.position.x - borderX && moveDir.moveDirection == 1)
{
moveScreenRight = false;
}
if (cameraTarget.transform.position.x < camera.transform.position.x - borderX && moveDir.moveDirection == 0)
{
moveScreenLeft = true;
}
if (moveScreenLeft)
{
float temp = Mathf.SmoothDamp(camera.transform.position.x, camera.transform.position.x - borderX, ref velocity.y, smoothTime);
camera.transform.position = new Vector3(temp, camera.transform.position.y, camera.transform.position.z);
}
if (cameraTarget.transform.position.x > camera.transform.position.x + borderX && moveDir.moveDirection == 0)
{
moveScreenLeft = false;
}
Vector3 temp2 = new Vector3(camera.transform.position.x, cameraHeight, camera.transform.position.z);
camera.transform.position = temp2;
}
}