Наследование: HoloToolkit.Sharing.Tests.SyncSpawnedObject
Пример #1
0
        private void Update()
        {
            // Spawn a basic spawned object when I is pressed
            if (Input.GetKeyDown(KeyCode.I))
            {
                Vector3    position = Random.onUnitSphere * 2;
                Quaternion rotation = Random.rotation;

                SyncSpawnedObject spawnedObject = new SyncSpawnedObject();

                SpawnManager.Spawn(spawnedObject, position, rotation, SpawnParent, "SpawnedObject", false);
            }

            // Spawn a test sphere when O is pressed
            if (Input.GetKeyDown(KeyCode.O))
            {
                Vector3    position = Random.onUnitSphere * 2;
                Quaternion rotation = Random.rotation;

                SyncSpawnTestSphere spawnedObject = new SyncSpawnTestSphere();
                spawnedObject.TestFloat.Value = Random.Range(0f, 100f);

                SpawnManager.Spawn(spawnedObject, position, rotation, SpawnParent, "SpawnTestSphere", false);
            }
        }
        public void SpawnCustomSyncObject()
        {
            Vector3    position = Random.onUnitSphere * 2;
            Quaternion rotation = Random.rotation;

            var spawnedObject = new SyncSpawnTestSphere();

            spawnedObject.TestFloat.Value = Random.Range(0f, 100f);

            spawnManager.Spawn(spawnedObject, position, rotation, spawnParentTransform.gameObject, "SpawnTestSphere", false);
        }
        public void SpawnCustomSyncObject()
        {
            Vector3    position = PositionCalibrator((Camera.main.transform.position + Camera.main.transform.forward), cameraHeight: true);
            Quaternion rotation = Random.rotation;

            var spawnedObject = new SyncSpawnTestSphere();

            spawnedObject.TestFloat.Value = Random.Range(0f, 100f);

            spawnManager.Spawn(spawnedObject, position, rotation, spawnParentTransform.gameObject, "SpawnTestSphere", false);
        }