• Wake me up when september ends (lies dir die geschichte zum lied mal durch. Sehr tiefgründig.)
  • The sound of silence von Disturbed (weil’s zu deinem geschmack passt.)
  • unravel cover von selphius melody auf youtube. (İst ein Anime opening cover aber ist nen’ toller song auch wenn du nicht auf anime stehst)
  • Starset - Let it die
  • Metallica - Nothing else matters (klassiker)
  • Linkin park - what i’ve done
  • Three days grace - Animal İ have become
  • Thousand foot krutch - The end is where we begin
  • Avril lavigne - My happy ending

Hoffe da ist was für dich dabei. Mfg.

...zur Antwort
Kennt sich jemand mit C# RPC's aus?

Hey Leute,

ich habe ein kleines C#-Skript für einen Tag-Nacht-Zyklus und würde es gerne mit Unity's UNet verknüpfen (?). Ich verstehe die Sache mit den RPC's nicht ganz und im Unity-Forum antwortet mir seit Tagen keiner .... Ich habe schon etwas improvisiert und es wird die vergangene Zeit im Inspektor angezeigt als Client bloß ändert sich nix in der Gameview. Ich glaube, ich muss [Command] benutzen. Aber wie genau?

Hier ist mein Skript:

using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;

public class DayNightCycle : NetworkBehaviour 
{
	//[SerializeField]
	[SyncVar]
	public float time;
	
	public TimeSpan currenttime;
	
	[SerializeField]
	public Transform SunTransform;
	
	public Light Sun;
	
	public Text timetext;
	
	[SyncVar]
	public int days;
	
	[SyncVar]
	public float intensity;
	
	[SyncVar]
	public int speed;
	
	// Update is called once per frame
	void Update () 
	{
		if(isServer)
		{
			ChangeTime();
		}
	}

	[ClientRpc]
	public void ChangeTime() 
	{
		if(isServer)
		{
			time += Time.deltaTime * speed;
			
			if(time > 86400) //86400 = 00:00
			{
				days += 1;
				time = 0;
			}
			
			currenttime = TimeSpan.FromSeconds (time);
			string[] temptime = currenttime.ToString () .Split (":"[0]);
			timetext.text = temptime[0] + ":" + temptime[1];
			SunTransform.rotation = Quaternion.Euler (new Vector3((time - 21600) / 86400 * 360, 0, 0));
		  
			if (time < 43200)
				intensity = 1 - (43200 - time) / 43200;
			else  //Even if i disable this lines there's no changing in the darkness of the game...
				intensity = 1 - ((43200 - time) / 43200 * -1);
		
			Sun.intensity = intensity;
		}
	} 
}
...zum Beitrag



using System.Collections; using System; using UnityEngine; using UnityEngine.UI; using UnityEngine.Networking;     public class DayNightCycle : NetworkBehaviour {       //[SerializeField] [SyncVar]public float time; public TimeSpan currenttime; [SerializeField] public Transform SunTransform; public Light Sun; public Text timetext; [SyncVar]public int days; [SyncVar]public float intensity; [SyncVar]public int speed; // Update is called once per frame void Update () {     if(isLocalPlayer) // Einfach zu local player mit einer return funktion geändert     return;        ChangeTime();     }     public void ChangeTime() {       //if(isServer){   // und diese zeile geschloßen (Irrelevant gewesen)        time += Time.deltaTime * speed;      if(time > 86400) //86400 = 00:00      {          days += 1;          time = 0;      }      currenttime = TimeSpan.FromSeconds (time);      string[] temptime = currenttime.ToString () .Split (":"[0]);      timetext.text = temptime[0] + ":" + temptime[1];      SunTransform.rotation = Quaternion.Euler (new Vector3((time-21600)/86400*360,0,0));      if (time < 43200)          intensity = 1 - (43200 - time) / 43200;      else                                                          intensity = 1 - ((43200 - time) / 43200 *-1);              Sun.intensity = intensity;          //}        }            }



...zur Antwort

Hör nicht auf die Leute die sagen, dass du das nicht packst. Mit genug zeit und Aufwand sollte es möglich sein.

Kommen wir zur Frage, ich kenne das Spiel leider nicht aber allgemein um Spiele zu schreiben wird meistens c# verwendet oder ist es ein Browserspiel? würde dir das Programm Unity raten sehr viele Tutorials im Netz. 

mfg

...zur Antwort