void Damage(AttackInfo attackInfo){
			GameObject effect = Instantiate (hitEffect, transform.position, Quaternion.identity) as GameObject;
			effect.transform.localPosition = transform.position + new Vector3 (0.0f, 0.5f, 0.0f);
			Destroy (effect, 0.3f);
			status.DamageHP (attackInfo.GetAttackPower());
			if(status.GetHP() <= 0){
					status.SetHP(0);
				//体力0でダウン
				ChangeState(State.Died);
			}
		}
예제 #2
0
				void Damage(AttackInfo attackInfo)
			{
				//ヒットエフェクト
				CreateHitEffect ();
				EffectPos ();
				Destroy (effect, 0.3f);

				//HPを減らす
				status.DamageHP(attackInfo.GetAttackPower());

				//死体を攻撃できないようにし、体力0なので倒れる
				try{
					eController.Down();
				}catch (UnityException e){
					Debug.Log("SaveExceptionLog : " + e);
					TextReadWriteManager write = new TextReadWriteManager();
					write.WriteTextFile(Application.dataPath + "/" + "ErrorLog_Cradle.txt", e.ToString());
				}
			}
예제 #3
0
		void Damage(AttackInfo attackInfo)
	{
		this.transform.root.SendMessage ("Damage",attackInfo);
	}
예제 #4
0
		public void FindAttackInfoComponent(){
			this.attackInfo = GetComponentInChildren<AttackInfo>();
		}