void activeAndDeactive() { //Debug.Log("gameobject : " + this.name); //Debug.Log("activate: " + PlayerSelection.name); //Debug.Log("activate: " + PlayerMesh.name); //Debug.Log("de activate: " + Menu.name); PlayerSelection.SetActive(true); PlayerMesh.SetActive(true); Menu.SetActive(false); }
public void OnBack() { //Debug.Log("gameobject : " + this.name); //Debug.Log("de activate: " + gameObject.name); //Debug.Log("activate: " + PlayerMesh.name); //Debug.Log("activate: " + PlayerSelection.name); gameObject.SetActive(false); PlayerMesh.SetActive(true); PlayerSelection.SetActive(true); }
private void Start() { // Getting components and setting them to relevant pointers m_UtilityScript = GetComponent <UtilityScoring>(); m_MoveScript = GetComponent <SimpleMovement>(); m_PathFinder = GetComponent <PathFinding>(); m_Inventory = GetComponent <CharacterInventory>(); m_Stats = GetComponent <CharacterStats>(); m_Mesh = GetComponentInChildren <PlayerMesh>(); // Mesh is actually in a child of the GameObject with this script attached to m_Queue = new LinkedList <QueuedTask>(); m_Audio = FindObjectOfType <AudioManager>(); }
public void OnBack() { //Debug.Log("Log out"); client.TcpSend("QUITGAME|" + client.getString("PlayerName")); client.remove("PlayerName"); //Debug.Log("gameobject : " + this.name); //Debug.Log("activate: " + Menu.name); //Debug.Log("activate: " + PlayerMesh.name); //Debug.Log("de activate: " + gameObject.name); Menu.SetActive(true); PlayerMesh.SetActive(false); gameObject.SetActive(false); }
public void Spawn() { string raceName = Enum.GetName(typeof(PLAYER_RACES), race).ToString().ToLower(); string sexName = Enum.GetName(typeof(PLAYER_SEXES), sex).ToString().ToLower(); PackedScene playerMeshResource = (PackedScene)ResourceLoader.Load($"res://prefabs/3d/characters/player/{raceName}/{sexName}/{sexName}.tscn"); mesh = playerMeshResource.Instance() as PlayerMesh; CallDeferred("add_child", mesh); animTree = mesh.FindNode("AnimationTree", true, false) as AnimationTree; orientation = mesh.GlobalTransform; orientation.origin = new Vector3(); Transform current = Transform; current.origin.x = position.x; current.origin.y = position.y; current.origin.z = position.z; Transform = current; }
public void SpawnAt(PlayerData _pData) { data = _pData; this.name = data.name; this.stats = data.stats; string raceName = Enum.GetName(typeof(PLAYER_RACES), data.race).ToString().ToLower(); string sexName = Enum.GetName(typeof(PLAYER_SEXES), data.sex).ToString().ToLower(); PackedScene playerMeshResource = (PackedScene)ResourceLoader.Load($"res://prefabs/3d/characters/player/{raceName}/{sexName}/{sexName}.tscn"); mesh = playerMeshResource.Instance() as PlayerMesh; AddChild(mesh); orientation = mesh.GlobalTransform; orientation.origin = new Vector3(); Transform current = Transform; current.origin.x = data.pos.X; current.origin.y = data.pos.Y; current.origin.z = data.pos.Z; Transform = current; //SetRotationDegrees(new Vector3(mesh.RotationDegrees.x, myPlayerData.heading, mesh.RotationDegrees.z)); < - this breaks the camera movement spawned = true; }
void Start() { _camera = Camera.main; _cameraMove = _camera.GetComponent<CameraMove>(); _cameraInput = _camera.GetComponent<CameraInput>(); _rigidbody = GetComponent<Rigidbody>(); _player = GetComponent<Player>(); _inputManger = InputManager.Instance; _mesh = transform.GetComponentInChildren<PlayerMesh>(); _state = State.Run; _outstandingPush = null; _animator = gameObject.GetComponentInChildren<Animator>(); }