using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class Player
{
Color damageColor;
Transform children;
void Start()
{
children = this.gameObject.GetComponentInChildren();
damageColor = new Color( 1.0f, 0.5f, 0.5f, 0.5f);
}
//ダメージ処理
private void Damage()
{
if( damageTime < 1){
SetMaterialColor( damageColor);
}
}
//マテリアルの色を設定する
private void SetMaterialColor(Color _color){
//子要素がいなければ終了
if (children.childCount == 0){
return;
}
foreach( Transform obj in children){
if( obj.name == "bone_1") return;
obj.GetComponent().material.color = _color;
}
}
}