本文整理汇总了C#中Stats.notifyInitialized方法的典型用法代码示例。如果您正苦于以下问题:C# Stats.notifyInitialized方法的具体用法?C# Stats.notifyInitialized怎么用?C# Stats.notifyInitialized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stats
的用法示例。
在下文中一共展示了Stats.notifyInitialized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
protected void Start()
{
if (mutationName != "" && this.gameObject.GetComponent<Mutations>() != null) { //If you levae a mutationName empty it will not account for it, so use this if you want non-tranferable mutations
if (!this.gameObject.GetComponent<Mutations>().mutations.Contains(mutationName)) {
this.gameObject.GetComponent<Mutations>().mutations.Add(mutationName); //adds mutation to this bacteria's current list of mutations
}
List<string> wedge;
}
stats = this.gameObject.GetComponent<Stats> ();
MutationInstance = null;
if (MutationObject != null) {
MutationInstance =(GameObject)Instantiate (MutationObject);
Vector3 ang = transform.eulerAngles; //holds current rotation for simple no-math solution
Vector3 scale = transform.localScale;
transform.localScale = Vector3.one;
transform.eulerAngles = Vector3.zero;
MutationInstance.transform.position = new Vector3(transform.position.x + MutationInstance.transform.position.x,transform.position.y + MutationInstance.transform.position.y,transform.position.z + MutationInstance.transform.position.z);
MutationInstance.transform.SetParent(this.gameObject.transform); //attaches the new mutation to its owner
transform.eulerAngles = ang;
transform.localScale = scale;
}
//all set changes for mutations from public input are made onto the cell's stats
stats.maxHealth += maxHealth;
stats.metabolism += metabolism;
stats.maturation += maturation;
stats.reproductionEfficiency += reproductionEfficiency;
stats.aggression += aggression;
stats.herbivorism += herbivorism;
stats.carnivoreism += carnivoreism;
stats.sightRadius += sightRadius;
stats.damage += damage;
stats.speed += speed;
stats.healing += healing;
stats.notifyInitialized(this);
}