コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        /*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();
        }
コード例 #5
0
 public PlayerBase(PlayerInitData init)
 {
     this.init = init;
     previous  = init.sync;
 }
コード例 #6
0
 public static void AddOtherPlayer(PlayerInitData init)
 {
     otherPlayers.Add(init.sync.userid, new OtherPlayer(init));
 }
コード例 #7
0
 public static void AddPlayer(PlayerInitData init)
 {
     player = new Player(init);
 }
コード例 #8
0
 public void Init(PlayerInitData init)
 {
     this.init = init;
 }