当前位置: 首页>>代码示例>>C#>>正文


C# Stats.notifyInitialized方法代码示例

本文整理汇总了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);
 }
开发者ID:ab9x3jhx6a,项目名称:Game4,代码行数:35,代码来源:Mutation.cs


注:本文中的Stats.notifyInitialized方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。