示例#1
0
 void Awake()
 {
     gameEntityController = gameObject.GetComponent<GameEntityController>() as GameEntityController;
     inputController = gameObject.GetComponent<IGameEntityInput>() as IGameEntityInput;
     networkFieldsDb.GetData();
     networkFieldsDef = networkFieldsDb.Clone();
     networkFieldsDef.Init();
 }
示例#2
0
 void Awake()
 {
     settings = Settings.Instance();
     util = Util.Instance;
     gameEntityController = gameObject.GetComponent<GameEntityController>() as GameEntityController;
     inputController = gameObject.GetComponent<IGameEntityInput>() as IGameEntityInput;
     networkFields = gameObject.GetComponent<NetworkFields>() as NetworkFields;
 }
示例#3
0
 void Awake()
 {
     gameEntityController = gameObject.GetComponent <GameEntityController>() as GameEntityController;
     inputController      = gameObject.GetComponent <IGameEntityInput>() as IGameEntityInput;
     networkFieldsDb.GetData();
     networkFieldsDef = networkFieldsDb.Clone();
     networkFieldsDef.Init();
 }
        public override void OnInspectorGUI()
        {
            so.Update();

            //db.Clear();
            def = db.GetData();
            EditorMode();
            so.ApplyModifiedProperties();

            db.Save(def);
            EditorUtility.SetDirty(db);
        }
示例#5
0
            public void SetNetworkFields(NetworkFields networkFields)
            {
                Vector3 forward = transform.forward;

                forward.y = 0;
                float heading = Quaternion.LookRotation(forward).eulerAngles.y;

                networkFields.SetPosition(transform.position);
                networkFields.SetFloat(GMKeyCode.PlayerSpeed, GetPlayerSpeed());
                networkFields.SetFloat(GMKeyCode.Heading, heading);

                if (!gameEntity.IsNpc())
                {
                    networkFields.SetFloat(GMKeyCode.Vaxis, inputController.GetFloat(GMKeyCode.Vaxis));
                    networkFields.SetFloat(GMKeyCode.Haxis, inputController.GetFloat(GMKeyCode.Haxis));
                    networkFields.SetBool(GMKeyCode.MouseRight, inputController.GetBool(GMKeyCode.MouseRight));
                }
            }
 void Start()
 {
     gameEntity = gameObject.GetComponent<IGameEntity>() as IGameEntity;
     networkFields = gameEntity.GetNetworkFields();
 }
            public void SetNetworkFields(NetworkFields networkFields)
            {
                Vector3 forward = transform.forward;
                forward.y = 0;
                float heading = Quaternion.LookRotation(forward).eulerAngles.y;

                networkFields.SetPosition(transform.position);
                networkFields.SetFloat(GMKeyCode.PlayerSpeed, GetPlayerSpeed());
                networkFields.SetFloat(GMKeyCode.Heading, heading);

                if (!gameEntity.IsNpc()) {
                    networkFields.SetFloat(GMKeyCode.Vaxis, inputController.GetFloat(GMKeyCode.Vaxis));
                    networkFields.SetFloat(GMKeyCode.Haxis, inputController.GetFloat(GMKeyCode.Haxis));
                    networkFields.SetBool(GMKeyCode.MouseRight, inputController.GetBool(GMKeyCode.MouseRight));
                }
            }
示例#8
0
 void Awake()
 {
     networkFields = gameObject.GetComponent<NetworkFields>() as NetworkFields;
 }
示例#9
0
 void OnEnable()
 {
     myTarget = (NetworkFields)target;
     so = new SerializedObject(target);
     prop = so.GetIterator();
 }
示例#10
0
 void Start()
 {
     gameEntity    = gameObject.GetComponent <IGameEntity>() as IGameEntity;
     networkFields = gameEntity.GetNetworkFields();
 }
 void OnEnable()
 {
     so = new SerializedObject(target);
     db = (NetworkFieldsDb)target;
     def = db.GetData();
     EnsureFields();
 }