Beispiel #1
0
        private static CustomEventCapture[] FromTransport(Google.Protobuf.Collections.RepeatedField <Transport.CustomEventCapture> transportCapture)
        {
            var curstomCapture = new CustomEventCapture[transportCapture.Count];

            for (int i = 0; i < transportCapture.Count; i++)
            {
                curstomCapture[i] = new CustomEventCapture(transportCapture[i].Time, transportCapture[i].Name, transportCapture[i].Contents);
            }
            return(curstomCapture);
        }
Beispiel #2
0
        public void OnCustomEvent(SubjectRecording subject, CustomEventCapture customEvent)
        {
            switch (customEvent.Name)
            {
            case "Box Destroyed":
                var dirtyCords = customEvent.Contents.Split(' ');
                Destroy(Instantiate(deathEffect, new Vector3(float.Parse(dirtyCords[0]), -10, float.Parse(dirtyCords[1])), Quaternion.Euler(-90, 0, 0)), 3f);
                break;

            case "Collision":
                var dirtyCollisionCords = customEvent.Contents.Split(' ');
                Destroy(Instantiate(collisionEffect, new Vector3(float.Parse(dirtyCollisionCords[0]), float.Parse(dirtyCollisionCords[1]), float.Parse(dirtyCollisionCords[2])), Quaternion.identity), 3f);
                break;

            default:
                Debug.LogWarningFormat("Don't know how to handle event type: {0}", customEvent.Name);
                break;
            }
        }