// Update is called once per frame void Update() { if (Mathf.Abs(mario.transform.position.x - transform.position.x) <= movedistance) { ismove = true; } else { ismove = false; } if (ismove) { duration -= Time.deltaTime; } if (duration <= 0) { GameObject clone = Instantiate(movingplatform, birthpalce.position, Quaternion.identity); move = clone.GetComponent <MoveVertical>(); move.up = up; move.down = down; move.direction = direction; move.canmove = true; duration = waittime; } }
// Start is called before the first frame update void Start() { manager = FindObjectOfType <LevelManager>(); mario = FindObjectOfType <Mario>().gameObject; move = GetComponent <MoveVertical>(); collider = GetComponent <CircleCollider2D>(); cansee = false; move.canmove = false; collider.enabled = false; starmanscore = 100; trutleshellscore = 500; dropscore = 0; firehitscore = 200; trampscore = 0; }