コード例 #1
0
 private void OnCollisionEnter(Collision collision)
 {
     if (GooManager.WithinGoo(GooType.Bounce, transform.position + new Vector3(0, -1, 0), 0.2f))
     {
         attachedRigidbody.AddForce(collision.impulse * bouncyness, ForceMode.Impulse);
     }
 }
コード例 #2
0
        //Physics methods
        private void FixedUpdate()
        {
            if (controller.Grounded)
            {
                if (GooManager.WithinGoo(GooType.Slide, transform.position + new Vector3(0, -1, 0), 0.2f))
                {
                    //Increase movement speed
                    controller.moveSpeed = slideSpeed;

                    //Remove all friction
                    material.staticFriction  = 0;
                    material.dynamicFriction = 0;
                    material.frictionCombine = PhysicMaterialCombine.Minimum;
                }
                else
                {
                    //Back to original speed
                    controller.moveSpeed = originalSpeed;

                    //Return friction
                    material.staticFriction  = originalSFriction;
                    material.dynamicFriction = originalDFriction;
                    material.frictionCombine = originalFrictionCombine;
                }
            }
        }
コード例 #3
0
 private IEnumerator Register()
 {
     while (!GooManager.Register(projection, type))
     {
         yield return(new WaitForFixedUpdate());
     }
 }
コード例 #4
0
ファイル: GooManager.cs プロジェクト: micodemo1/MonoNoke
 private void Awake()
 {
     //Initialize singleton
     if (singleton == null)
     {
         singleton = this;
     }
     else if (singleton != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #5
0
 private void Deregister()
 {
     GooManager.Deregister(projection, type);
 }