本文整理汇总了C#中Root.setScale方法的典型用法代码示例。如果您正苦于以下问题:C# Root.setScale方法的具体用法?C# Root.setScale怎么用?C# Root.setScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Root
的用法示例。
在下文中一共展示了Root.setScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
_t = transform;
name = "creature" + gameObject.GetInstanceID();
eth = Ether.getInstance();
settings = Settings.getInstance();
crt_count = GameObject.Find("CreatureCount").GetComponent<CreatureCount>();
max_root_scale = new Vector3();
max_root_scale.x = float.Parse( settings.contents["creature"]["root"]["max_root_scale"]["x"].ToString() );
max_root_scale.y = float.Parse( settings.contents["creature"]["root"]["max_root_scale"]["y"].ToString() );
max_root_scale.z = float.Parse( settings.contents["creature"]["root"]["max_root_scale"]["z"].ToString() );
min_root_scale = new Vector3();
min_root_scale.x = float.Parse( settings.contents["creature"]["root"]["min_root_scale"]["x"].ToString() );
min_root_scale.y = float.Parse( settings.contents["creature"]["root"]["min_root_scale"]["y"].ToString() );
min_root_scale.z = float.Parse( settings.contents["creature"]["root"]["min_root_scale"]["z"].ToString() );
root = GameObject.CreatePrimitive(PrimitiveType.Cube);
root.name = "root";
root.transform.parent = _t;
root.transform.position = _t.position;
root.transform.eulerAngles = _t.eulerAngles;
root.AddComponent<Rigidbody>();
root_script = root.AddComponent<Root>();
root_script.setColour(chromosome.getColour());
root_script.setScale(chromosome.getRootScale());
//root.rigidbody.mass = 15F;
root.GetComponent<Rigidbody>().angularDrag = float.Parse( settings.contents["creature"]["angular_drag"].ToString() );
root.GetComponent<Rigidbody>().drag = float.Parse( settings.contents["creature"]["drag"].ToString() );
eye = new GameObject();
eye.name = "Eye";
eye.transform.parent = root.transform;
eye.transform.eulerAngles = root.transform.eulerAngles;
eye.transform.position = root.transform.position;
eye_script = eye.AddComponent<Eye>();
mouth = new GameObject();
mouth.name = "Mouth";
mouth.transform.parent = root.transform;
mouth.transform.eulerAngles = root.transform.eulerAngles;
mouth.transform.localPosition = new Vector3(0,0,.5F);
mouth.AddComponent<Mouth>();
genital = new GameObject();
genital.name = "Genital";
genital.transform.parent = root.transform;
genital.transform.eulerAngles = root.transform.eulerAngles;
genital.transform.localPosition = new Vector3(0,0,-.5F);
genital.AddComponent<Genitalia>();
line_of_sight = (double) settings.contents ["creature"]["line_of_sight"];
metabolic_rate = (double) settings.contents ["creature"]["metabolic_rate"];
age_sexual_maturity = (int) settings.contents ["creature"]["age_sexual_maturity"];
setupLimbs();
age = 0.0D;
state = State.neutral;
food_eaten = 0;
offspring = 0;
InvokeRepeating("updateState",0,0.1f);
InvokeRepeating("metabolise",1.0f,1.0f);
InvokeRepeating("RandomDirection", 1F, 5F);
root.GetComponent<Rigidbody>().SetDensity(4F);
}