本文整理汇总了C#中UnityEngine.Rigidbody类的典型用法代码示例。如果您正苦于以下问题:C# Rigidbody类的具体用法?C# Rigidbody怎么用?C# Rigidbody使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Rigidbody类属于UnityEngine命名空间,在下文中一共展示了Rigidbody类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
rigidBody = GetComponent<Rigidbody>();
wkDamage = 1;
strDamage = 5;
supstrDamage = 10;
}
开发者ID:SuedeHarman,项目名称:SourceTree1,代码行数:7,代码来源:bulletControl.cs
示例2: Start
// Use this for initialization
void Start()
{
rb = GetComponent<Rigidbody>();
DontDestroyOnLoad(dLight);
setCount(count);
winText.text = "";
}
开发者ID:Jonicon,项目名称:Unity,代码行数:8,代码来源:PlayerController.cs
示例3: Start
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody>();
moveDirection.x = Random.Range(0, 360);
moveDirection.z = Random.Range(0, 360);
transform.eulerAngles = moveDirection;
}
开发者ID:NateGursslin,项目名称:School-Work,代码行数:8,代码来源:EnemyMovement.cs
示例4: Start
void Start()
{
rb = GetComponent<Rigidbody> ();
count = 0;
result = 0;
setResultText();
}
开发者ID:gczarnocki,项目名称:roll-a-ball,代码行数:7,代码来源:PlayerController.cs
示例5: Start
void Start()
{
rigidBody = GetComponent<Rigidbody>();
count = 0;
SetCountText();
winText.text = string.Empty;
}
开发者ID:Saurutobi,项目名称:UnityTutorials,代码行数:7,代码来源:PlayerController.cs
示例6: Start
void Start()
{
OuterCollider = GetComponentInParent<Collider>();
if(OuterCollider == null)
{
Debug.Warning("level", "Hiding Place " + gameObject.name + " has no outer collider.");
}
HidingTrigger = GetComponent<Collider>();
if (HidingTrigger == null)
{
Debug.Warning("level", "Hiding Place " + gameObject.name + " has no inner trigger.");
}
else
{
if (!HidingTrigger.isTrigger)
{
HidingTrigger.isTrigger = true;
}
RBody = GetComponent<Rigidbody>();
if (RBody == null)
{
RBody = gameObject.AddComponent<Rigidbody>();
}
RBody.isKinematic = true;
RBody.useGravity = false;
}
}
开发者ID:xela10104,项目名称:qk-pop-1,代码行数:29,代码来源:Hideout.cs
示例7: Start
void Start()
{
activated = false;
rb = GetComponent<Rigidbody> ();
current = transform.position;
current.y = maxHeight;
}
开发者ID:dabolink,项目名称:Roll-A-Ball,代码行数:7,代码来源:ElevatorController.cs
示例8: Awake
void Awake()
{
floorMask = LayerMask.GetMask("Floor");
anim = GetComponent<Animator>();
pRigidBody = GetComponent<Rigidbody>();
}
开发者ID:BernardCastello,项目名称:Dream-Guardian,代码行数:7,代码来源:PlayerMove.cs
示例9: Start
void Start()
{
player = GameObject.FindWithTag ("Player").transform;
pHealth = player.GetComponent<PlayerHealth> ();
eHealth = GetComponent<EnemyHealth> ();
Rigidbody = GetComponent<Rigidbody> ();
}
开发者ID:ltrout,项目名称:TankBattle,代码行数:7,代码来源:EnemyMovement.cs
示例10: Start
// Use this for initialization
void Start()
{
IsTrapOn = false;
pos = transform.position;
myRigidbody = GetComponent<Rigidbody>();
rot = Vector3.zero;
}
开发者ID:hirama-akihiro,项目名称:StealAdventer,代码行数:8,代码来源:rightRotateScript.cs
示例11: Start
// Use this for initialization
void Start()
{
// Script References
shipGraphics = GetComponent<ShipGraphics>();
shipPhysicsScript = GetComponent<ShipPhysicsScript>();
// Component Variables
cam = GetComponentInChildren<Camera>();
body = GetComponent<Rigidbody>();
model = transform.Find("Model").gameObject;
capsuleCollider = GetComponentInChildren<CapsuleCollider>();
boxCollider = GetComponentInChildren<BoxCollider>();
lockSound = GetComponent<AudioSource>();
// Control Variables
mouseSensitivity = 8.0f;
//mouseThreshold = 8.0f;
//buttonSensitivity = 0.05f;
//buttonThreshold = 0.05f;
horTranslation = 0.0f;
verTranslation = 0.0f;
enemyNoLock = (Material)Resources.Load("Crosshair");
enemyLock = (Material)Resources.Load("Crosshair_Enemy");
trackedObject = null;
trackingResults = null;
shootWaitTime = 0.0f;
targetTime = 0.0f;
hits = 0;
}
开发者ID:henryj41043,项目名称:Project_GRAVITY,代码行数:33,代码来源:ShipDataScript.cs
示例12: Start
void Start()
{
bullet = this.GetComponent<Rigidbody>();
bullet.AddForce(this.transform.forward * thrust);
GameObject.Destroy(this.gameObject, 3.0f);
}
开发者ID:DarioDomiDE,项目名称:SwitchWitch,代码行数:7,代码来源:BulletMovement.cs
示例13: Start
// Update is called once per frame
void Start()
{
robot = gameObject.GetComponent<Rigidbody>();
target = GameObject.FindGameObjectWithTag("plane11").transform;
targetOriginal = GameObject.FindGameObjectWithTag("plane12").transform;
flag = false;
}
开发者ID:Ahan2,项目名称:Spacescape,代码行数:8,代码来源:AmandaScript6.cs
示例14: Awake
private void Awake()
{
floorMask = LayerMask.GetMask ("Floor");
anim = GetComponent <Animator> ();
playerRigidbody = GetComponent <Rigidbody> ();
mainCamera = GameObject.Find ("Main Camera 2").GetComponent<Camera>();
}
开发者ID:dannyhicco,项目名称:survival-shooter,代码行数:7,代码来源:PlayerMovement2.cs
示例15: Start
// Use this for initialization
void Start()
{
rb = GetComponent<Rigidbody> ();
FindTarget ();
InvokeRepeating ("FindTarget", 5.0F, 5.0F);
InvokeRepeating ("FireMissileAtTarget", Random.Range (1.0f, 3.0f), 3.0f);
}
开发者ID:jonathan84clark,项目名称:OrbitalDebris1,代码行数:8,代码来源:FireMissile.cs
示例16: Start
// Use this for initialization
void Start()
{
thisRidgedBody = this.GetComponent<Rigidbody>();
direction = transform.forward + transform.right;
viewportPos = Camera.main.WorldToViewportPoint(this.transform.position);
//this.transform.position += new Vector3(-0.2f, 0, 0);
}
开发者ID:jtuxbury,项目名称:GummiShipClone,代码行数:8,代码来源:BulletTesting.cs
示例17: Init
protected int _timeToDie = 0; // Timer after _timeToLive goes negative before deactivation.
public override void Init(IInteractionBehaviour interactionBehaviour, ActivityManager manager) {
_interactionBehaviour = interactionBehaviour;
_manager = manager;
Revive();
_rigidbody = GetComponent<Rigidbody>();
}
开发者ID:WilliamRADFunk,项目名称:vedic,代码行数:9,代码来源:ActivityMonitor.cs
示例18: changeGameObject
void changeGameObject(Rigidbody newBody)
{
GameObject oldPlanet = CurrentPlanet;
CurrentPlanet = Instantiate(newBody, oldPlanet.transform.position, oldPlanet.transform.rotation) as GameObject;
Camera.main.SendMessage ("changePlanet", CurrentPlanet.transform);
Destroy (oldPlanet);
}
开发者ID:JoelHough,项目名称:vr-assessment,代码行数:7,代码来源:switch_planet.cs
示例19: AddConnectedBody
public void AddConnectedBody(Rigidbody rigidbody)
{
if (!connectedBodies.Contains(rigidbody))
{
connectedBodies.Add(rigidbody);
}
}
开发者ID:ricklove,项目名称:BlockWars,代码行数:7,代码来源:SimpleJoint.cs
示例20: Awake
void Awake()
{
myTransform = GetComponent<Transform>();
myRigidBody = GetComponent<Rigidbody>();
myHealth = GetComponent<Health>();
BloodParticle = GetComponentInChildren<ParticleSystem>();
}
开发者ID:Xellss,项目名称:StrangeRituals,代码行数:7,代码来源:EnemyController.cs
注:本文中的UnityEngine.Rigidbody类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论