Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

PauloJunior

Member
  • Content Count

    56
  • Joined

  • Last visited

Community Reputation

26 Excellent

About PauloJunior

  • Rank
    Member
  • Birthday 02/23/1997

Contact Methods

  • MSN
    paulo45190@hotmail.com
  • Yahoo
    paulo45190@ymail.com
  • Skype
    pjunior45190

Profile Information

  • Location:
    Near Gotham City

Recent Profile Visitors

861 profile views
  1. using System.Threading; using System; public static class ProgrammersDay{ public static void Main(string[] agv){ string message = "Happy Programmer's Day!!!!!"; if(DateTime.Now.Month == 9 && DateTime.Now.Day == 13){ for(int i = 0; i < message.Length; i++){ Thread.Sleep(150); Console.Write(message.ToString()); } } } }
  2. Because the Javascript is a programming language likes the others and the language more used in the world.
  3. Thanks bro, i'm happy to have helped.
  4. This script is different the script above, because use PhotonHastables, i hope to have helped. using UnityEngine; using System.Collections; using PhotonHash = ExitGames.Client.Photon.Hashtable; #region ENUMS_REGIONS public enum GameMode { DM = 0, TM = 1, EX = 2 } public enum Map { BedRock = 0, Springfield = 1, Gotham = 2, SouthPark = 3 } #endregion //CLASS LOADER public abstract class LoaderScene { private static AsyncOperation async = null; private static Map map = Map.BedRock; private static string[] mapList = new string[] { "badrock_map", // === 0 "springfield_map", // === 1 "gotham_map", // === 2 "southpark_map" // === 3 }; public static float progress { get { if(async == null) { return 0; } return async.progress; } } public static bool isLoading { get { if(async == null) { return false; } return !async.isDone; } } public static bool isDone { get { if (async == null) return false; return async.isDone; } } public static Map mapLoading { get { return map; } } public static void LoadMap(Map mapLoad) { async = Application.LoadLevelAsync(mapList[(int)mapLoad]); map = mapLoad; } } public class LobbyScript : MonoBehaviour { #region STATIC_METHODS public static TypedLobby typpedLobby { //IT'S IMPORTANT ONLY YOU CAN TO GET ATTRIBUTES IN LOBBY WHEN LOBBY IS 'SqlLobby', 'Default' Doesn't Work get{ return new TypedLobby("MainLobby", LobbyType.SqlLobby); } } public static bool CreateRoom(string roomName, GameMode mode, Map map){ PhotonHash hash = new PhotonHash(); hash.Add("mode", (int)mode); hash.Add("map", (int)map); //YOU CAN TO ADD MORE HASH RoomOptions options = new RoomOptions(); options.customRoomProperties = hash; //THE LINE BELOW IS IMPORTANT HERE THAT SHOW THE ATTRIBUTES IN LOBBY //YOU ONLY CAN TO GET THIS ATTRIBUTES IN LOBBY options.customRoomPropertiesForLobby = new string [] {"mode", "map"}; return PhotonNetwork.CreateRoom(roomName, options, typpedLobby); } #endregion public Vector2 scroll = Vector2.zero; //TO SHOW THE ROOMS YOU NEED TO CHANGE LOBBY void OnConnectedToMaster(){ //CHANGING LOBBY PhotonNetwork.JoinLobby(typpedLobby); print("Lobby Changed"); } void OnJoinedLobby() { PhotonNetwork.automaticallySyncScene = false; } // Use this for initialization void Start () { PhotonNetwork.ConnectUsingSettings("1.0v"); } void OnGUI(){ GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString()); //ROOM LIST if(PhotonNetwork.connected && PhotonNetwork.insideLobby && !LoaderScene.isLoading){ GUI.Box(new Rect(Screen.width / 2 - 175, Screen.height / 2 - 150, 350, 300), "ROOM LIST"); GUILayout.BeginArea(new Rect(Screen.width / 2 - 175, Screen.height / 2 - 150, 350, 300)); GUILayout.Space(25); if(GUILayout.Button("Create Room")) { Map loadMap = Map.Gotham; if(CreateRoom("Room " + PhotonNetwork.GetRoomList().Length + 1, GameMode.DM, loadMap)) { LoaderScene.LoadMap(loadMap); } } scroll = GUILayout.BeginScrollView(scroll); foreach(RoomInfo room in PhotonNetwork.GetRoomList()) { GameMode mode = (GameMode)((int)room.customProperties["mode"]); Map map = (Map)((int)room.customProperties["map"]); GUILayout.BeginHorizontal(); GUILayout.Label(room.name); GUILayout.Label(string.Format("{0}/{1}", room.playerCount, room.maxPlayers)); GUILayout.Label("MODE " + mode.ToString()); GUILayout.Label("MAP " + map.ToString()); if (GUILayout.Button("ENTER")) { if (PhotonNetwork.JoinRoom(room.name)) { LoaderScene.LoadMap(map); } } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.EndArea(); } //SHOW BAR LOADING if (LoaderScene.isLoading) { float width = LoaderScene.progress * 300; GUI.color = Color.Lerp(Color.red, Color.green, LoaderScene.progress); GUI.DrawTexture(new Rect(Screen.width / 2 - 175, Screen.height / 2 - 50, width, 50), Texture2D.whiteTexture); GUI.color = Color.white; GUI.Label(new Rect(Screen.width / 2 - 175, Screen.height / 2 - 75, width, 50), "LOADING SCENE " + LoaderScene.mapLoading.ToString()); } } }
  5. https://www.dropbox.com/s/dz8zlabga90t1uk/EditorExample.unitypackage?dl=0 Examples: http://coder.dm/custom-editors-in-unity-c-example/
  6. Insert @script ExecuteInEditMode() at first line
  7. PauloJunior

    News

    https://www.dropbox.com/s/qgef7zngfa65coh/News.rar?dl=0 I HAVE HELPED
  8. PauloJunior

    News

    Ok I will make a base for you.
  9. using UnityEngine; using System.Collections; public class NetworkCharacter :MonoBehaviour { Vector3 realPosition = Vector3.zero; Quaternion realRotation = Quaternion.identity; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if(networkView.isMine ) { // Do nothing -- the character motor/input/etc... is moving us } else { transform.position = Vector3.Lerp(transform.position, realPosition, 0.1f); transform.rotation = Quaternion.Lerp(transform.rotation, realRotation, 0.1f); } } public void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) { if(stream.isWriting) { // This is OUR player. We need to send our actual position to the network. realPosition = transform.position; realRotation = transfrom.rotation; stream.Serialize(ref realPosition); stream.Serialize(ref realRotation); } else { // This is someone else's player. We need to receive their position (as of a few // millisecond ago, and update our version of that player. stream.Serialize(ref realPosition); stream.Serialize(ref realRotation); } } } Hope this helps
  10. PauloJunior

    News

    you save the news in a database (MySQL, SQLServer, etc ..) or php. In unity you use the WWWForm to get the string that stores the news.
  11. /* Script CircularBarSimple By Paulo Junior */ var progress : float = 100.0; var radiu : float = 25.0; var property : Rect = Rect( 0, 0, 20, 20); var color : Color32 = Color32(255, 0, 0, 255); private var startprogress : float; private var _tex : Texture2D; function Start (){ startprogress = progress; _tex = CreateTexture(color); //Never put it in loop } function Update (){ progress = Mathf.Clamp(progress, 0, startprogress); //Limit } function OnGUI() { var middle : Vector2 = new Vector2(Screen.width / 2, Screen.height / 2) + Vector2(property.x, property.y); //Middle Screen //Example for(var i : int in range(progress)){ var angle : float = (i / startprogress) * 360.0f; //Calculating Angle GUIUtility.RotateAroundPivot(angle, middle); //Rotate GUIScreen GUI.DrawTexture(Rect(middle.x - property.width, middle.y - (property.height / 2) + radiu, property.width, property.height), _tex); //DrawTexture GUIUtility.RotateAroundPivot(-angle, middle); //Inverting GUIScreen angle } } function CreateTexture(cor : Color32) : Texture2D{ var x : int = 0; //PosX Pixel var y : int = 0; //PosY Pixel var w : int = 10; //Width var h : int = 20; //Height var tex : Texture2D = new Texture2D(w, h, TextureFormat.ARGB32, false); //Create Texture for(var i : int in range(w * h)){ if(x == w){ x = 0; y++; } tex.SetPixel(x, y, cor);//Set Pixel Color x++; } tex.Apply(); //Apply Texture return tex; //Return Texture }
×
×
  • Create New...