coll.GetComponent<Rigidbody>().isKinematic =true; coll.GetComponent<Renderer>().material.SetColor("_Color", Color.white); coll.GetComponent<InteractableObjectOutline>().enabled =false; } } 开发者ID:Dawnwoodgames,项目名称:LotsOfTowers,代码行数:11,代码来源:FractureSnapTrigger.cs 示例14: OnTriggerSt...
Rigidbody rig = GetComponent<Rigidbody>(); Collider collider = GetComponent<Collider>(); Animator animator = GetComponent<Animator>(); AIControllerComponent aiController = GetComponent<AIControllerComponent>(); if (GetComponent<HealthComponent>().Health < 0) { rig.isKinematic = true; collider.enable...
Player.instance.LetGo(); thing.GetComponent<Rigidbody>().isKinematic =true; thing.transform.position = box.position; thing.transform.parent = box; GameManager.instance.CheckForGoal((int)thing.objeto); } } 开发者ID:TheJorlu,项目名称:SuperGame,代码行数:15,代码来源:Carrito.cs 注:本文中的Thing...
enable;varrigidbody = gameObject.GetComponent<Rigidbody>();if(enable) { rigidbody.useGravity =false; rigidbody.isKinematic =true; }else{ rigidbody.mass =1.0f; rigidbody.useGravity =true; rigidbody.isKinematic =false; }varanimators = gameObject.GetComponentsInChildren<Animator>();for(varanim...
other.GetComponent<Rigidbody>().isKinematic =false; } } 開發者ID:DeSanguinist,項目名稱:CobbleGame,代碼行數:7,代碼來源:KillNavmeshAgent.cs 示例12: OnTriggerEnter ▲點讚 1▼ voidOnTriggerEnter(Collider collider){ BaseVel = collider.gameObject.GetComponent<Rigidbody> ().velocity;//Camera.main.Scree...
GameObject player = GameObject.FindGameObjectWithTag("Ship");GetComponent<Rigidbody2D>().isKinematic =false;//print("collision detected with: " + other.ToString());SpringJoint2D spring = gameObject.AddComponent<SpringJoint2D>(); spring.connectedBody = player.gameObject.GetComponent<Rigidbody2D>();...
other.transform.position = ballSpawn.position;// Reset velocityother.GetComponentInParent<Rigidbody2D> ().isKinematic =true; other.GetComponentInParent<Rigidbody2D> ().isKinematic =false; } } 开发者ID:karthikb351,项目名称:ggj2016-game,代码行数:10,代码来源:BallRespawner.cs ...
new_item = obj.GetComponentInParent<Rigidbody> ();if(new_item !=null&& !new_item.isKinematic) { Pickup (new_item);returntrue; }else{ Debug.Log ("Can't pick up "+ obj.name);returnfalse; } } 开发者ID:emccrckn,项目名称:DadSimulator,代码行数:13,代码来源:Hand.cs ...
Rigidbody[] pieces = other.gameObject.GetComponentsInChildren<Rigidbody>();foreach(Rigidbody pieceinpieces) { piece.isKinematic =false; piece.AddExplosionForce(500, other.gameObject.transform.position,5); } BoxCollider goocollider = other.GetComponent<BoxCollider>(); ...