예제 #1
0
        private void FixedUpdate()
        {
            if (!InvalidPress())
            {
                if (Input.GetKey(KeyCode.A))
                {
                    rb.MovePosition(rb.position - (Vector3.right * Speed));
                }

                if (Input.GetKey(KeyCode.D))
                {
                    rb.MovePosition(rb.position + (Vector3.right * Speed));
                }
            }

            if (env.bonusSphere.Collided)
            {
                env.ResetAllPositions();
            }

            if (OutOfBounds())
            {
                env.ResetAllPositions();
            }
        }
예제 #2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (GUILayout.Button("Reset All Positions"))
            {
                Debug.Log("Resetting All Positions");
                TestingEnvironment e = (TestingEnvironment)target;
                e.ResetAllPositions();
            }
        }