public override void Start() { generator = GameObject.FindObjectOfType <GrailMapGenerator>(); Context.Get <ColorPaletteSystem>().UpdateFog(fogDistance); if (players.Count == 0) { viewportRects.ForEach(r => { PlayerElement player = Instantiate(playerPrefab); player.SetViewPortRect(r); player.action += OnAction; players.Add(player); }); } players.ForEach(p => { p.gameObject.SetActive(true); p.transform.SetPositionAndRotation(generator.GetRandomPosition(), Quaternion.identity); }); }
public override void Start() { Context.Get <ColorPaletteSystem>().UpdateFog(20); fader = GameObject.FindObjectOfType <FaderElement>(); topDownCamera = GameObject.FindGameObjectWithTag("TopDownCamera").GetComponent <Camera>(); topDownCamera.enabled = true; generator = GameObject.FindObjectOfType <GrailMapGenerator>(); generator.Build(); GrailElement grailInstance = Instantiate(grailPrefab, generator.GetRandomPosition(), Quaternion.identity); fader.Out(() => { if (handle != null) { handle.Dispose(); } handle = Observable.Timer(TimeSpan.FromSeconds(examineDuration)).Subscribe((xs) => { Change <SeekState>().Setup(grailInstance); }); }); }