Example #1
0
        public void SetFloat(GMKeyCode code, float value)
        {
            FieldSet set      = codeMap[code];
            int      intValue = GmUtil.FloatToInt(value);

            SetUserValue(set, intValue);
        }
Example #2
0
        public float GetFloat(GMKeyCode code)
        {
            FieldSet set   = codeMap[code];
            int      value = GetUserValue(set.gmField);

            return(GmUtil.IntToFloat(value));
        }
Example #3
0
 public static void SetRotation(BuildObject buildObject, Quaternion rotation)
 {
     buildObject.rw = GmUtil.FloatToInt(rotation.w);
     buildObject.rx = GmUtil.FloatToInt(rotation.x);
     buildObject.ry = GmUtil.FloatToInt(rotation.y);
     buildObject.rz = GmUtil.FloatToInt(rotation.z);
 }
Example #4
0
            public IGameEntity CreateFromNetwork(string entityId, Character character, TrackData trackData)
            {
                Vector3        spawnPosition = GmUtil.TrackdataToVector3(trackData);
                GameEntityType entityType    = GameEntity.GameEntityTypeFromTrackData(trackData);
                Vector3        spawnPoint    = SpawnPoint.Instance().GetNpcSpawnpoint(spawnPosition);
                IGameEntity    gameEntity    = Create(entityId, character, entityType, spawnPoint, ControllerType.Remote);

                return(gameEntity);
            }
Example #5
0
        public static Quaternion GetRotation(BuildObject buildObject)
        {
            Quaternion r = new Quaternion();

            r.w = GmUtil.IntToFloat(buildObject.rw);
            r.x = GmUtil.IntToFloat(buildObject.rx);
            r.y = GmUtil.IntToFloat(buildObject.ry);
            r.z = GmUtil.IntToFloat(buildObject.rz);
            return(r);
        }
Example #6
0
 public Vector3 GetCharacterSpawnpoint(Character character)
 {
     if (character.worldx != 0 && character.worldz != 0)
     {
         float x = GmUtil.IntToFloat(character.worldx);
         float y = GmUtil.IntToFloat(character.worldy);
         float z = GmUtil.IntToFloat(character.worldz);
         return(new Vector3(x, y, z));
     }
     else
     {
         return(GmUtil.Infinity);
     }
 }
Example #7
0
 public void UpdateFromNetwork(TrackData trackData, bool hasDelta)
 {
     this.trackData = trackData;
     if (trackData.broadcast != 1)
     {
         if (hasDelta)
         {
             position = GmUtil.TrackdataDeltaToVector3(trackData, position);
         }
         else
         {
             position = GmUtil.TrackdataToVector3(trackData);
         }
     }
 }
Example #8
0
        private void ShowInvites(GuildInvites invites)
        {
            GmUtil.DestroyChildren(invitePanel.transform);
            foreach (GuildInvite invite in invites.guildInvite)
            {
                GameObject go = GameObject.Instantiate(inviteTemplate);
                go.SetActive(true);
                go.transform.SetParent(invitePanel.transform);
                go.name = invite.guildId;
                Text text = go.transform.Find("invite_text").GetComponent <Text>();
                text.text = "Invite to " + invite.guildId;

                GuildInviteInfo info = go.GetComponent <GuildInviteInfo>();
                info.guildId = invite.guildId;
                info.from    = invite.from;
                info.to      = invite.to;
            }
        }
Example #9
0
 public void SetRotation(Quaternion value)
 {
     trackData = GmUtil.QuaternionToTrackData(value, trackData);
 }
Example #10
0
 public void SetSecondaryVector3(Vector3 value)
 {
     trackData.userDefinedData = GmUtil.Vector3ToUserDefinedData(value, trackData.userDefinedData);
 }
Example #11
0
 public void SetPosition(Vector3 value)
 {
     trackData = GmUtil.Vector3ToTrackData(value, trackData);
 }
Example #12
0
 public Quaternion GetRotation()
 {
     return(GmUtil.TrackdataToQuaternion(trackData));
 }
Example #13
0
 public Vector3 GetSecondaryVector3()
 {
     return(GmUtil.UserDefinedDataToVector3(trackData.userDefinedData));
 }