public bool Raycast(Vector3 origin, Vector3 direction, out Uniject.RaycastHit hitinfo, float distance, int layerMask) { UnityEngine.RaycastHit unityHit = new UnityEngine.RaycastHit(); bool result = UnityEngine.Physics.Raycast(origin, direction, out unityHit, distance, layerMask); if (result) { TestableGameObject testable = null; UnityGameObjectBridge bridge = unityHit.collider.gameObject.GetComponent <UnityGameObjectBridge>(); if (null != bridge) { testable = bridge.wrapping; } hitinfo = new RaycastHit(unityHit.point, unityHit.normal, unityHit.barycentricCoordinate, unityHit.distance, unityHit.triangleIndex, unityHit.textureCoord, unityHit.textureCoord2, unityHit.lightmapCoord, testable, unityHit.collider); } else { hitinfo = new RaycastHit(); } return(result); }
public TestableInput(TestableGameObject obj, IInput input, Sphere sphere) : base(obj) { this.sphere = sphere; this.input = input; }
public void UnRegisterGameobject(TestableGameObject obj) { if (!(objects.Contains(obj) || toAdd.Contains(obj))) { throw new ArgumentException("Removing non existent game object"); } toRemove.Add(obj); }
public void RegisterGameobject(TestableGameObject obj) { if (objects.Contains(obj) || toAdd.Contains(obj)) { throw new ArgumentException("Duplicate game object"); } toAdd.Add(obj); }
public UnityAudioListener(TestableGameObject parent, GameObject obj) : base(parent) { AudioListener listener = obj.GetComponent<AudioListener>(); if (null == listener) { obj.AddComponent<AudioListener>(); } }
public UnityAudioListener(TestableGameObject parent, GameObject obj) : base(parent) { AudioListener listener = obj.GetComponent <AudioListener>(); if (null == listener) { obj.AddComponent <AudioListener>(); } }
public Collision(Vector3 relativeVelocity, ITransform transform, TestableGameObject gameObject, ContactPoint[] contacts) : this() { this.relativeVelocity = relativeVelocity; this.transform = transform; this.gameObject = gameObject; this.contacts = contacts; }
public Sphere(TestableGameObject obj, IRigidBody body, ISphereCollider collider, [Resource("mesh/sphere")] TestableGameObject sphere) { this.obj = obj; this.collider = collider; this.body = body; sphere.transform.Parent = obj.transform; }
public TestableExample(TestableGameObject parent, IAudioSource source, Sphere sphere, [Resource("audio/beep")] AudioClip beep) : base(parent) { this.source = source; this.beep = beep; this.Obj.transform.localScale = new Vector3(5, 5, 5); }
public TestableExample(TestableGameObject parent, ISphereCollider collider, IRigidBody body, IResourceLoader loader) : base(parent) { this.collider = collider; this.body = body; this.collider.radius = 5.0f; this.body.mass = 4.0f; loader.instantiate("Sphere").transform.Parent = Obj.transform; }
public BouncingLight(TestableGameObject obj, Sphere sphere, [Resource("physic/bouncy")] IPhysicMaterial material, ILight light, Random rand) : base(obj) { this.light = light; this.rand = rand; sphere.collider.material = material; light.intensity = 2.0f; light.range = 15; }
public ScanningLaser(TestableGameObject obj, Box box, [GameObjectBoundary] Sphere sphere, IPhysics physics, IRigidBody body, ILayerMask layerMask) : base(obj) { this.physics = physics; this.sphere = sphere; body.useGravity = false; sphere.collider.enabled = false; box.Obj.transform.localScale = new UnityEngine.Vector3(10, 1, 1); sphere.body.isKinematic = true; body.AddTorque(new UnityEngine.Vector3(0, 5, 0), UnityEngine.ForceMode.Impulse); mask = 1 << layerMask.NameToLayer("Default"); }
public Character(TestableGameObject obj, IRigidBody body, IBoxCollider collider /*[Resource("Characters/char")] TestableGameObject character*/ ) : base(obj) { this.obj = obj; this.collider = collider; this.body = body; body.isKinematic = true; TestableGameObject character = new UnityGameObject(GameManager.instance.Character); character.transform.Parent = obj.transform; character.transform.LocalPosition = Vector3.zero; obj.transform.Position = GameManager.instance.LevelController.StartTransform.position; GameManager.instance.CanRun = true; //старт }
public RaycastHit(Vector3 point, Vector3 normal, Vector3 barycentricCoordinate, float distance, int triangleIndex, Vector2 textureCoord, Vector2 textureCoord2, Vector2 lightmapCoord, TestableGameObject hit, Collider collider) : this() { this.point = point; this.normal = normal; this.barycentricCoordinate = barycentricCoordinate; this.distance = distance; this.triangleIndex = triangleIndex; this.textureCoord = textureCoord; this.textureCoord2 = textureCoord2; this.lightmapCoord = lightmapCoord; this.hit = hit; this.collider = collider; }
public HasSingletonTime(TestableGameObject obj, ITime time) : base(obj) { injectedTime = time; }
public HasSingletonInput(TestableGameObject obj, IInput input) : base(obj) { injectedInput = input; }
public HasInjectedPrefab(TestableGameObject parent, [Resource("mesh/sphere")] TestableGameObject nested) : base(parent) { this.nested = nested; nested.transform.Parent = this.Obj.transform; }
public TestableComponent(TestableGameObject obj) { this.enabled = true; this.obj = obj; obj.registerComponent(this); }
public Character( TestableGameObject parent, ITime time ) : base( parent ) { this.time = time; }
public FakeComponent(TestableGameObject obj) : base(obj) { this.obj = obj; }
public FakeAudioSource(TestableGameObject obj) : base(obj) { }
public Box(TestableGameObject obj, IBoxCollider collider, [Resource("mesh/cube")] TestableGameObject cubeMesh) { this.Obj = obj; cubeMesh.transform.Parent = obj.transform; }
public HasInjectedGameObjects([GameObjectBoundary] TestableGameObject a, [GameObjectBoundary] TestableGameObject b) { this.a = a; this.b = b; }
public IntervalBasedCallback(TestableGameObject obj, ITime time) : base(obj) { this.time = time; }
public FakeAudioListener(TestableGameObject obj) : base(obj) { }
public KeyboradInput(TestableGameObject obj, ICharacterInput input, Character character) : base(obj) { this.Character = character; this._characterInput = input; }
public FakeSphereCollider(TestableGameObject obj) : base(obj) { }
public HasSingletonScreen(TestableGameObject obj, IScreen screen) : base(obj) { injectedScreen = screen; }
public FakeNavmeshAgent(TestableGameObject obj) : base(obj) { }
public HasGameObjectBoundaryAsParameter(TestableGameObject obj, MockComponent nested) : base(obj) { this.nested = nested; this.nested.Obj.transform.Parent = this.Obj.transform; }
public CharacterMobileInput(TestableGameObject go, IInput input) : base(go) { _input = input; }
public HasOnCollision(TestableGameObject obj) : base(obj) { }
public MockComponent(TestableGameObject obj) : base(obj) { }
public HasMissingAttributedPrefab([Resource("does/not/exist")] TestableGameObject obj) { }
public MockTime(TestableGameObject obj) : base(obj) { DeltaTime = 1.0f; }
public HasGameObjectBoundaryAsParameter(TestableGameObject obj, MockComponent nested) : base(obj) { this.nested = nested; }