public void Init(PlayerInitData init) { this.init = init; transform.position = new Vector3(init.sync.xpos, init.sync.ypos, init.sync.zpos); transform.localEulerAngles = new Vector3(0, init.sync.yrot, 0); if (init.sync.animestate == 0 || init.sync.animestate == 1) { haveGun = true; } else { haveGun = false; } if (init.faction == 0) { box.GetComponent <Renderer>().material.color = Color.cyan; } else { box.GetComponent <Renderer>().material.color = Color.magenta; } }
public Player(PlayerInitData init) : base(init) { prefab = new PrefabManager(); prefab.LoadPrefab("Player"); prefab.GetInstance().GetComponent <PlayerPrefabScript>().Init(init); hp = new PrefabManager(); hp.LoadPrefab("HPText", GameObject.Find("Canvas").transform); hp.GetInstance().GetComponent <HPTextScript>().Init(init); }
public OtherPlayer(PlayerInitData init) : base(init) { prefab = new PrefabManager(); prefab.LoadPrefab("OtherPlayer"); prefab.GetInstance().GetComponent <OtherPlayerPrefabScript>().Init(init); if (Players.GetPlayer().GetFaction() == init.faction) { name = new PrefabManager(); name.LoadPrefab("NamePlate", GameObject.Find("Canvas").transform); name.GetInstance().GetComponent <NamePlateScript>().Init(prefab.GetInstance().transform, init.username); } }
/*void Start() * { * anime = GetComponentInChildren<Animator>(); * * animeState = 1; * SetAnime(); * * previous_xrot = 0; * latest_xrot = 0; * }*/ public void Init(PlayerInitData init) { this.init = init; anime = GetComponentInChildren <Animator>(); transform.position = new Vector3(init.sync.xpos, init.sync.ypos, init.sync.zpos); previous_xrot = init.sync.xrot; latest_xrot = init.sync.xrot; transform.localEulerAngles = new Vector3(0, init.sync.yrot, 0); this.animeState = init.sync.animestate; SetAnime(); }
public PlayerBase(PlayerInitData init) { this.init = init; previous = init.sync; }
public static void AddOtherPlayer(PlayerInitData init) { otherPlayers.Add(init.sync.userid, new OtherPlayer(init)); }
public static void AddPlayer(PlayerInitData init) { player = new Player(init); }
public void Init(PlayerInitData init) { this.init = init; }