本文整理汇总了C#中UnityEngine.Rigidbody类的典型用法代码示例。如果您正苦于以下问题:C# Rigidbody类的具体用法?C# Rigidbody怎么用?C# Rigidbody使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Rigidbody类属于UnityEngine命名空间,在下文中一共展示了Rigidbody类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
rigidBody = GetComponent<Rigidbody>();
wkDamage = 1;
strDamage = 5;
supstrDamage = 10;
}
示例2: Start
// Use this for initialization
void Start()
{
rb = GetComponent<Rigidbody>();
DontDestroyOnLoad(dLight);
setCount(count);
winText.text = "";
}
示例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;
}
示例4: Start
void Start()
{
rb = GetComponent<Rigidbody> ();
count = 0;
result = 0;
setResultText();
}
示例5: Start
void Start()
{
rigidBody = GetComponent<Rigidbody>();
count = 0;
SetCountText();
winText.text = string.Empty;
}
示例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;
}
}
示例7: Start
void Start()
{
activated = false;
rb = GetComponent<Rigidbody> ();
current = transform.position;
current.y = maxHeight;
}
示例8: Awake
void Awake()
{
floorMask = LayerMask.GetMask("Floor");
anim = GetComponent<Animator>();
pRigidBody = GetComponent<Rigidbody>();
}
示例9: Start
void Start()
{
player = GameObject.FindWithTag ("Player").transform;
pHealth = player.GetComponent<PlayerHealth> ();
eHealth = GetComponent<EnemyHealth> ();
Rigidbody = GetComponent<Rigidbody> ();
}
示例10: Start
// Use this for initialization
void Start()
{
IsTrapOn = false;
pos = transform.position;
myRigidbody = GetComponent<Rigidbody>();
rot = Vector3.zero;
}
示例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;
}
示例12: Start
void Start()
{
bullet = this.GetComponent<Rigidbody>();
bullet.AddForce(this.transform.forward * thrust);
GameObject.Destroy(this.gameObject, 3.0f);
}
示例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;
}
示例14: Awake
private void Awake()
{
floorMask = LayerMask.GetMask ("Floor");
anim = GetComponent <Animator> ();
playerRigidbody = GetComponent <Rigidbody> ();
mainCamera = GameObject.Find ("Main Camera 2").GetComponent<Camera>();
}
示例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);
}