public void setupJSONActionEase(AnimatorTimeline.JSONAction a) { a.easeType = easeType; if(hasCustomEase()) a.customEase = customEase.ToArray(); else a.customEase = new float[]{}; }
// Update is called once per frame void FixedUpdate () { endTime = Time.time; if(state == 0 || (playerwon.winState != 0 && Gameover == false)) { if(inc == true) { if(scale <= 1.05f) scale += 0.005f; else inc = false; } else { if(scale >= 0.95f) scale -= 0.005f; else inc = true; } } if(state == 1) { AnimatorTimeline.Play("Take1"); state = 2; } else if(state == 4) { if(Player2start == false) { AnimatorTimeline.Play("Take2"); //players[1].animation.Play(); Player2start = true; } /*rotationY += Input.GetAxis("Mouse Y")*lookSpeed; rotationY = Mathf.Clamp (rotationY, -90, 90);*/ //players[0].transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left); //players[0].transform.position += players[0].transform.right*moveSpeed*Input.GetAxis("Horizontal"); rotationX += Input.GetAxis("Mouse X")*lookSpeed; players[0].transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up); players[0].transform.position += players[0].transform.forward*moveSpeed*Input.GetAxis("Vertical"); /* if (grounded) { // Calculate how fast we should be moving Vector3 targetVelocity = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); targetVelocity = transform.TransformDirection(targetVelocity); targetVelocity *= speed; // Apply a force that attempts to reach our target velocity Vector3 velocity = players[0].rigidbody.velocity; Vector3 velocityChange = (targetVelocity - velocity); velocityChange.x = Mathf.Clamp(velocityChange.x, -maxVelocityChange, maxVelocityChange); velocityChange.z = Mathf.Clamp(velocityChange.z, -maxVelocityChange, maxVelocityChange); velocityChange.y = 0; players[0].rigidbody.AddForce(velocityChange, ForceMode.VelocityChange); Debug.Log("Jump"); // Jump if (canJump && Input.GetButton("Jump")) { players[0].rigidbody.velocity = new Vector3(velocity.x, CalculateJumpVerticalSpeed(), velocity.z); } } // We apply gravity manually for more tuning control players[0].rigidbody.AddForce(new Vector3 (0, -gravity * players[0].rigidbody.mass, 0)); grounded = false; */ /*var v = Input.GetAxisRaw("Vertical"); var h = Input.GetAxisRaw("Horizontal"); Transform cameraTransform = Camera.main.transform; Vector3 forward = cameraTransform.TransformDirection(Vector3.forward); Vector3 right = new Vector3(forward.z, 0, -forward.x); forward.y = 0; forward = forward.normalized; Vector3 targetDir = forward * v + right * h; //1st Player Controls if(Input.GetKeyDown(KeyCode.W)){ //players[1].transform.position += forward * 1; players[0].rigidbody.AddForce(targetDir.normalized * (500)); //players[0].rigidbody. } else if(Input.GetKey(KeyCode.A)){ players[0].rigidbody.AddTorque(targetDir.normalized * (500)); //players[0].animation.Stop(); } else if(Input.GetKey(KeyCode.D)){ }*/ } }
private static void setupHashEase(Hashtable hashTable, AnimatorTimeline.JSONAction a) { /*if(a.customEase.Length > 0) { AnimationCurve easeCurve = AMTween.GenerateCurve(a.customEase); hashTable.Add("easecurve",easeCurve); } else { hashTable.Add("easetype",(AMTween.EaseType)a.easeType); }*/ Debug.LogError("implement me"); }