void Start() { testAuido = GetComponent <AudioSource>(); tag = E_Tag.Player; ParentStart(); P_status = GetComponent <PlayerStatus>(); animator = GetComponent <Animator>(); Mode = ModeList[0]; Mode.obj = this; Mode.player = this; Mode.Mode_Start(this); P_ModeBase p_mode = (P_ModeBase)Mode; recorder.SetTargetKey(p_mode.targetkeylist); BaseScale_x = transform.lossyScale.x; //;//エネミーの元々のスケールを取得 //GameObject Enemy Move_Dest = Move_Vec.sqrMagnitude; //ベクトルの平方根を取る Move_Vec_Norm = Move_Vec.normalized; //床当たり判定の読み込み Isground = GetComponentInChildren <Player_IsGround>(); //rigidbodyの読み込み rb = GetComponent <Rigidbody2D>(); pre_mode_index = modeindex; }
public override bool Equition(Charactor _obj, ModeBase _mode) { if (_obj.tag.ToString() == "Player") { TestPlayer _player = _obj.GetComponent <TestPlayer>(); //MPが足りているか P_ModeBase pmode = (P_ModeBase)targetmode; if (_player.status.MP >= pmode.MP) { return(true); } } //もし不足していたら効果音を鳴らす return(false); }