コード例 #1
0
ファイル: Unit.cs プロジェクト: JohnnyVox/schoolfire
 public void Start()
 {
     // cache for quick lookup
     behavior = GetComponent<Behavior>();
     health = GetComponent<Health>();
     health.onDeath += destroySelf;
 }
コード例 #2
0
ファイル: EnemyBuilding.cs プロジェクト: JohnnyVox/schoolfire
        public void Start()
        {
            // cache for quick lookup
            health = GetComponent<Health>();
            behavior = GetComponent<Behavior>();

            // continue initialization by resetting the variables
            reset();
        }
コード例 #3
0
ファイル: IsAlive.cs プロジェクト: JohnnyVox/schoolfire
 public override void OnStart()
 {
     // the target may be null if it has been destoryed. In that case set the health to null and return
     if (target.Value == null) {
         health = null;
         return;
     }
     // cache the health component
     health = target.Value.GetComponent<Health>();
 }