首页 > > 详细

辅导Rigidbody 、java 语言程序讲解留学生、辅导留学生java 、java 程序辅导留学生

, Rigidbody 。
。:
1) for AddComponent、 GetComponent
GameObject (),;
2) 、、, Mathf
id,
( 1);
3) ,, vector3

4) id,
id ;
5) id ,
RigidbodyConstraints 。

this.transform..Translate(vector3.normalize( —
))*obj[id];
vector3.Distance(( , )/( *Time.deltime));



using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
public class find : MonoBehaviour
{
void Start()
{
GameObject[] bj = FindObjectsOfType(typeof(GameObject)) as GameObject[];//

// string[] arrName = new string[] { };
float Width, Length, Height, center;
ArrayList arrarea = new ArrayList();//
int id = 0;
ArrayList area = new ArrayList();//
for (int i = 0; i ();//
obj[i].AddComponent();//
obj[i].GetComponent().useGravity = false;
BoxCollider bc = obj[i].GetComponent();
Width = Mathf.Abs(bc.bounds.size.x);
Length = Mathf.Abs(bc.bounds.size.y);
Height = Mathf.Abs(bc.bounds.size.z);
area.Add(Mathf.Max(Width * Length, Mathf.Max(Width * Height, Length *
Height)));
Debug.Log(area[i]);
Debug.Log(obj[i].gameObject.name);
}
area.Sort();//
Debug.Log(obj[1].gameObject.name);
obj[1].GetComponent().isKinematic = true;//
ArrayList distance= new ArrayList();//
for (int j = 1; j ().isKinematic = false;
obj[j].GetComponent().freezeRotation = false;
obj[j].GetComponent().constraints =
RigidbodyConstraints.FreezePositionX;
//
Vector3 m = new Vector3(0, 0, 0);
Vector3 n = new Vector3(0, 0, 0);
m = obj[0].transform.position;
n = obj[j].transform.position;
distance.Add(Vector3.Distance(m, n));
}
distance.Sort();
for(int k = 0; k ().velocity = Vector3.forward *
TranslateSpeed1;
}
else
continue;
k++;
}
while (k < obj.Length);*/
}
void Update()
{
}


}

 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!