Jump to content

darkrurik

Registered
  • Posts

    3
  • Joined

  • Last visited

Posts posted by darkrurik

  1. the thing I want to do is equal to crafting.HARVEST_RESOURCE but without animation and without being near a tree to hit it I just want the points

    Crafting.Instance.HarvestResource(resourceIDS);

    add points to the green line as in the attached image

     

    1.jpg

  2. hello I created the possibility to add the points of the Skills via code as I can make them effective since when reboot game are lost thanks

    here’s how I did

    Skill playerSkill = Skills.Instance.PlayerSkills[enable ID];
    playerSkill.exp = playerSkill.exp + 1;

  3. Resolve:

     

     

    TimeManager:

    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;
    
    public class TimeManager : MonoBehaviour {
    
    static TimeManager instance;
    
    public string timeGameObjectName;
    int day;
    int hour;
    int minute;
    float second = -1;
       int worldTimeSpeed = 1;
    string currentTime = "";
    
    float delay = 3;
    float updateTime = -1;
    float lastFrameTime = -1;
    
    // Use this for initialization
    void Start () {
    	instance = this;
    	NetworkAPI.RegisterExtensionMessageHandler("server_time", ServerTimeMessage);
    }
    
    // Update is called once per frame
    void Update () {
    	if (second == -1)
    		return;
    
    	// Recalculate the current time
    	second += (Time.realtimeSinceStartup - lastFrameTime) * worldTimeSpeed;
    	lastFrameTime = Time.realtimeSinceStartup;
    	if (second >= 60) {
    		int minutesPassed = (int)second / 60;
    		second -= 60 * minutesPassed;
    		minute += minutesPassed;
    
    		if (minute >= 60) {
    			minute -= 60;
    			hour += 1;
    		}
    		if (hour >= 24) {
    			hour -= 24;
    			day += 1;
    		}
    
    		// Send out a time update message since the minute/hour has changed
    		string[] args = new string[1];
    		AtavismEventSystem.DispatchEvent("WORLD_TIME_UPDATE", args);
    		//Debug.Log("Time is now: " + hour + ":" + minute + " with deltaTime: " + Time.deltaTime + " and minutesPassed: " + minutesPassed);
    	}
    
    	if (timeGameObjectName != "" && updateTime != -1 && Time.time > updateTime) {
    		GameObject timeReqGameObject = GameObject.Find(timeGameObjectName);
    		if (timeReqGameObject != null) {
    			timeReqGameObject.SendMessage("SetSecond", second);
    			timeReqGameObject.SendMessage("SetMinute", minute);
    			timeReqGameObject.SendMessage("SetHour", hour);
    			timeReqGameObject.SendMessage("SetDay", day);
    		}
    		updateTime = -1;
    	}
    }
    
    public void ServerTimeMessage(Dictionary props) {
    	day = (int)props["day"];
    	hour = (int)props["hour"];
    	minute = (int)props["minute"];
    	second = (int)props["second"];
    	worldTimeSpeed = (int)props["worldTimeSpeed"];
    	//Debug.Log("Got Server Time Message with Day: " + day + ", hour: " + hour + ". minute: " + minute);
    	lastFrameTime = Time.realtimeSinceStartup;
    	updateTime = Time.time + delay;
    }
    
    public static TimeManager Instance {
    	get {
    		return instance;
    	}
    }
    
    public string CurrentTime {
    	get {
    		return currentTime;
    	}
    }
    
    public int Hour {
    	get {
    		return hour;
    	}
    }
    
    public int Minute {
    	get {
    		return minute;
    	}
    }
    
       public float Second
       {
           get {
               return second;
           }
       }
    
       public int Day
       {
           get
           {
               return day;
           }
       }
    
    }
    

     

    UGUIWorldTimeDisplayPersonal:

    using UnityEngine;
    using System;
    using UnityEngine.UI;
    using System.Collections;
    
    public class UGUIWorldTimeDisplayPersonal : MonoBehaviour {
       //
       public GameObject uniStormSystem;
       //
       public string day;
       //
       public int Month;
       //
       public int Year;
       //
       public string hour;
       //
       public string minute;
       //
       public string second;
       //
       public string timeText;
       //
       public string dateText;
       //
       void Awake()
       {
           //
           uniStormSystem = GameObject.Find("UniStormSystemEditor");
           //
       }
       //
       // Use this for initialization
       //
       void Start () {
           //
    	AtavismEventSystem.RegisterEvent("WORLD_TIME_UPDATE", this);
           //
           Month = System.DateTime.Now.Month;
           //
           Year = System.DateTime.Now.Year;
           //
           uniStormSystem.GetComponent().monthCounter = Month;
           //
           uniStormSystem.GetComponent().yearCounter = Year;
           //
           UpdateTimeDisplay();
           //
    
       }
       //
       // Update is called once per frame
       //
       void Update()
       {
           //
           dateText = System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
           //
           UpdateTimeDisplay();
           //
       }
       //
       void OnDestroy() {
           //
           AtavismEventSystem.UnregisterEvent("WORLD_TIME_UPDATE", this);
           //
       }
       //
    public void OnEvent(AtavismEventData eData) {
           //
           if (eData.eventType == "WORLD_TIME_UPDATE") {
               //
               UpdateTimeDisplay();
               //
           }
           //
    }
    //
    void UpdateTimeDisplay() {
           //
           if (timeText != null) {
               //
    		// Get time from the time system and set it to the text
               //
    		hour = TimeManager.Instance.Hour.ToString();
               //
    		if (TimeManager.Instance.Hour < 10) {
                   //
    			hour = "0" + hour;
                   //
    		}
               //
    		minute = TimeManager.Instance.Minute.ToString();
               //
    		if (TimeManager.Instance.Minute < 10) {
                   //
    			minute = "0" + minute;
                   //
    		}
               //
               second = TimeManager.Instance.Second.ToString();
               //
    		if (TimeManager.Instance.Second < 10) {
                   //
                   second = "0" + second;
                   //
    		}
               //
               day = TimeManager.Instance.Day.ToString();
               //
               timeText = day + " / " + hour + ":" + minute + ":" + second;
               //
               //Hour = uniStormSystem.GetComponent().hourCounter;
               //
               uniStormSystem.GetComponent().dayCounter = TimeManager.Instance.Day;
               //
               uniStormSystem.GetComponent().hourCounter = TimeManager.Instance.Hour;
               //
               uniStormSystem.GetComponent().minuteCounter = TimeManager.Instance.Minute;
               //
           }
           //
       }
       //
    }
    

  4. I look for graphic for to create terrestrial with Terrain Composer 2 in specific 4 islands will give you sketches of as I am now and it will need to create her with dimensions more elevated uniforms in the zones and connected by trade.

     

    1) Mountains and Valleys Northerly

    2) Volcanic Island South

    3) Jungle East

    4) Ices and crystals and Green Owest

     

    to build the territory 20000 Xs 10000 with angles to 12 degrees

     

    Ps: on the price it puts on us daccordo thanks

     

    size=200http://unity.darkrurik.com/unitymaterials/disegni/area_1.png[/img]

    size=200http://unity.darkrurik.com/unitymaterials/disegni/3f6e699a-f06b-49af-96cc-7b99bf60f1ac.jpg[/img]

    size=200http://unity.darkrurik.com/unitymaterials/disegni/2016-01-21-23_12_36.jpg[/img]

  5. ok

    how should I set the whole change in each file ui and put a variable that changes in that file or as

     

    cmq is designed so good in the update do not lose anything at most you change the parameters again

     

    You could give an example of how I have to do thanks

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.