public static void NewGame() { Objects = new List <GameObject> (); Map = new Tile[MAP_WIDTH, MAP_HEIGHT]; Log = new List <Message>(); abilityGUI = new AbilityGUI(); statusGUI = new StatusGUI(); equipmentGUI = new EquipmentGUI(5); inventoryGUI = new InventoryGUI(); Map = MapMaker.MakeTunnelMap(false); miniMap = new MiniMap(30, 20, Map); PlayerObject = new GameObject(StartPosition.x, StartPosition.y, "hero", 120, 200, (int)(0.05 * Game1.WIDTH - 124.21), (int)(0.61 * Game1.HEIGHT - 670)); PlayerObject.Player = new Player(10); PlayerObject.Player.Owner = PlayerObject; PlayerObject.Fighter = new Fighter(2, 5, 0, 0); PlayerObject.Fighter.Owner = PlayerObject; Objects.Add(PlayerObject); DeathScreen.OnStart(); Started = true; ToRemove = new List <GameObject>(); GoToPlaying(); //Console.Out.WriteLine(PlayerObject.x.ToString() + ";" + PlayerObject.y.ToString()); //Console.Out.WriteLine("Position : " + PlayerObject.Position.x.ToString() + ";" + PlayerObject.Position.y.ToString()); //Console.Out.WriteLine("InventoryWidth:" + InventoryWidth.ToString()); }
void Awake() { areaNotText = FindObjectOfType <AreaNotificationText>(); cameraController = FindObjectOfType <CameraController>(); plrInter = FindObjectOfType <PlayerInteract>(); gamemanager = FindObjectOfType <GameManager>(); soundController = GetComponentInChildren <PlayerSoundController>(); playerDashParticleController = GetComponentInChildren <PlayerDashParticleController>(); playerMovement = GetComponent <PlayerMovement>(); AmuletFlash = FindObjectOfType <TheFirstFlash>(); statusGUI = FindObjectOfType <StatusGUI>(); footPrintParticles = transform.Find("FootprintParticles").GetComponent <ParticleSystem>(); landParticles = transform.Find("LandParticles").GetComponent <ParticleSystem>(); jumpParticles = transform.Find("JumpParticles").GetComponent <ParticleSystem>(); wallJumpParticles_left = transform.Find("WallJumpParticlesLeft").GetComponent <ParticleSystem>(); wallJumpParticles_right = transform.Find("WallJumpParticlesRight").GetComponent <ParticleSystem>(); enemyKillCount = new Dictionary <string, int>(); Inventory[] equipments = GetComponents <Inventory>(); for (int i = 0; i < equipments.Length; i++) { if (equipments[i].inventoryUI.name == "EquipmentUI") { equipment = equipments[i]; } else { hubChest = equipments[i]; } } craftWindow.equipment = equipment; craftWindow.hubChest = hubChest; }
private void MudancaDeEstado(StatusGUI _STATUS_GUI_ANT, StatusGUI _STATUS_GUI) { if (_STATUS_GUI_ANT == StatusGUI.DesenhandoCaminho && _STATUS_GUI == StatusGUI.Normal) { UltimoPontoInteracao = null; } }
private void MudancaDeEstado(StatusGUI _STATUS_GUI_ANT, StatusGUI _STATUS_GUI) { if (_STATUS_GUI_ANT == StatusGUI.DesenhandoCaminho && _STATUS_GUI == StatusGUI.Normal) { btNovoCaminho.Text = "Novo Caminho"; btNovoCaminho.Visibility = ViewStates.Invisible; UltimoPontoInteracao = null; } }
private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; } DontDestroyOnLoad(gameObject); }
} //[Gafgar: Sat/01-02-2020]: not sure if we want this? We can just go with a character controller right? private void Awake() { m_LoadData.Ctrl = GetComponent <CharacterController>(); m_LoadData.Cam = GetComponentInChildren <Camera>(); mLeanPos.y = 3; mCameraStartOffset = mCameraOffset = Ctrl.transform.InverseTransformPoint(Cam.transform.position); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; APlayerState[] states = GetComponents <APlayerState>(); foreach (var sate in states) { sate.Setup(this); } if (mState) { mState.Enter(this, null); } _statusGUI = GetComponentInChildren <StatusGUI>(); }