public IEnumerator loadGameObjects() { player = GameObject.FindGameObjectWithTag("Player"); cloud = GetComponent <Cloud>(); danmakuSystem = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <DanmakuSystem>(); monumentSystem = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MonumentSystem>(); yield return(new WaitForSeconds(1)); player.transform.position = Save.PlayerPosition; if (MonumentSystem.Graves != null) { foreach (GraveInfo g in MonumentSystem.Graves) { if (g.Level == CurrentLevel) { Instantiate(monumentSystem.monumentPrefabs[g.Style], new Vector3(g.PositionX, g.PositionY, g.PositionZ), Quaternion.identity); } yield return(0); } } if (MonumentSystem.Bodys != null) { foreach (BodyInfo b in MonumentSystem.Bodys) { if (b.Level == CurrentLevel) { GameObject body = Instantiate(monumentSystem.BodyPrefab, new Vector3(b.PositionX, b.PositionY, b.PositionZ), Quaternion.identity) as GameObject; body.AddComponent <BodyAction>().setBodyInfo(b); } yield return(0); } } }
// Use this for initialization void Start() { monumentSystem = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <MonumentSystem>(); pe = GameObject.FindGameObjectWithTag("Player").GetComponent <person>(); }