protected override void LoadMap() { map = new TileMap(content.Load <TiledMap>("TileMaps//level0/Level0-map"), graphics); Paralax p1 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p2"), graphics, Vector2.Zero, new Vector2((float)0.2, 0)); Paralax p2 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p1"), graphics, new Vector2(-1, 0), new Vector2((float)0.5, (float)0.9)); Paralax p3 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p0"), graphics, Vector2.Zero, new Vector2((float)0.4, (float)0.1)); Paralax p4 = new Paralax(content.Load <Texture2D>("Backgrounds/Level0/l0p3"), graphics, Vector2.Zero, new Vector2((float)0.3, (float)0)); _paralaxes.Add(p1); _paralaxes.Add(p4); _paralaxes.Add(p3); _paralaxes.Add(p2); }
protected override void LoadMap() { map = new TileMap(content.Load <TiledMap>("TileMaps//level3/Level3-map"), graphics); Paralax p1 = new Paralax(content.Load <Texture2D>("Backgrounds/Level3/l3p1"), graphics, Vector2.Zero, new Vector2((float)0.5, 0)); Paralax p3 = new Paralax(content.Load <Texture2D>("Backgrounds/Level3/l3p2"), graphics, Vector2.Zero, new Vector2((float)0.2, (float)0)); _paralaxes.Add(p3); _paralaxes.Add(p1); effect = content.Load <Effect>("shaders/lightEffect"); isLightShader = true; }
private void Start() { am = FindObjectOfType <AudioManager>(); cl = FindObjectOfType <CanvasLife>(); pl = FindObjectOfType <Paralax>(); foreach (WallMaterial w in FindObjectsOfType <WallMaterial>()) { if (w.transform.position.x < 0)//left walls belong to player 1 and right walls to player 2 { wallsPlayerOne.Add(w); } else { wallsPlayerTwo.Add(w); } } /////////////////////////////// GameEvents.OnGameStart.AddListener(SetNewGame); GameEvents.OnGameEnd.AddListener(StopGame); }
// Use this for initialization void Start() { Transform T = Instantiate(paralaxContainer).transform; T.parent = transform; T.localPosition = T.localPosition = new Vector3(1, paralaxContainer.transform.localPosition.y, 0); T.localScale = paralaxContainer.transform.localScale; T = Instantiate(paralaxContainer).transform; T.parent = transform; T.localPosition = T.localPosition = new Vector3(-1, paralaxContainer.transform.localPosition.y, 0); T.localScale = paralaxContainer.transform.localScale; startPosition = transform.position.x; length = GetComponent <SpriteRenderer>().bounds.size.x; cameraPlayer = FindObjectOfType <Camera2D>().transform; eParalax = transform.Find("eParalax"); sParalax = transform.Find("sParalax"); l = Paralax.SetarLimits(); Debug.Log(length); }
private void Awake() { bm = FindObjectOfType <BuildingManager>(); pl = FindObjectOfType <Paralax>(); GameEvents.OnGameStart.AddListener(SetLifeImages); }
// Use this for initialization void Start() { current = this; }