當前位置: 首頁>>代碼示例>>C#>>正文


C# UnityEngine.Rigidbody類代碼示例

本文整理匯總了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;
 }
開發者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


注:本文中的UnityEngine.Rigidbody類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。