private void HitFoldOut(ref FighterStatus.HitBox_ hitBox_) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical("Box"); EditorGUILayout.LabelField("Position"); //Undoに対応 Undo.RecordObject(fighterStatus, "fighterStatus"); hitBox_.localPosition.x = EditorGUILayout.FloatField("X", hitBox_.localPosition.x); hitBox_.localPosition.y = EditorGUILayout.FloatField("Y", hitBox_.localPosition.y); hitBox_.localPosition.z = EditorGUILayout.FloatField("Z", hitBox_.localPosition.z); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical("Box"); EditorGUILayout.LabelField("サイズ"); hitBox_.size.x = EditorGUILayout.FloatField("X", hitBox_.size.x); hitBox_.size.y = EditorGUILayout.FloatField("Y", hitBox_.size.y); hitBox_.size.z = EditorGUILayout.FloatField("Z", hitBox_.size.z); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); }
private void DefaultBoxMoving(ref List <FighterSkill.FrameHitBox> _defs, ref int _number, ref BoxCollider _col, FighterStatus.HitBox_ _hit) { //最初に当たり判定をデフォに Vector3 tt = _hit.localPosition; tt.x *= RightLeft; _col.center = tt; _col.size = _hit.size; if ((_defs == null) || (_defs.Count == 0)) { return; } if (_defs.Count > _number + 1) { //現在再生中の次フレームを越えれば if (_defs[_number + 1].startFrame <= core.AnimationPlayerCompornent.NowFrame) { //処理 _number++; } } //ループ時 else { if (_defs[0].startFrame <= core.AnimationPlayerCompornent.NowFrame && _defs[_number].startFrame > core.AnimationPlayerCompornent.NowFrame || (_defs.Count == 1 && _defs[_number].startFrame == core.AnimationPlayerCompornent.NowFrame)) { //処理 _number = 0; } } if (_number < 0) { return; } if (_defs[_number].endFrame < core.AnimationPlayerCompornent.NowFrame) { Vector3 tmp = _hit.localPosition; tmp.x *= RightLeft; _col.center = tmp; _col.size = _hit.size; return; } else { //常時当たり判定を移動 Vector3 tmp = _defs[_number].hitBox.localPosition + _hit.localPosition; tmp.x *= RightLeft; _col.center = tmp; //サイズ _col.size = _hit.size + _defs[_number].hitBox.size; } }
private void DefaultColInit(ref List <FighterSkill.FrameHitBox> _hit, ref BoxCollider _col, FighterStatus.HitBox_ _hitbox, List <FighterSkill.FrameHitBox> _plusBox, ref int _number, bool _flag) { if (_flag) { _col.gameObject.SetActive(true); //デフォルトの大きさに Vector3 cent = new Vector3(_hitbox.localPosition.x * RightLeft, _hitbox.localPosition.y, _hitbox.localPosition.z); _col.center = cent; _col.size = _hitbox.size; _hit = new List <FighterSkill.FrameHitBox>(_plusBox); if (_hit.Count > 1) { _hit.Sort((a, b) => a.startFrame - b.startFrame); } _number = -1; } else { _col.gameObject.SetActive(false); } //if (core.NowPlaySkill.headFlag) //{ // headCollider.gameObject.SetActive(true); // //デフォルトの大きさに // headCollider.center = core.Status.headHitBox.localPosition; // headCollider.size = core.Status.headHitBox.size; // heads = new List<FighterSkill.FrameHitBox>(core.NowPlaySkill.plusHeadHitBox); // if (heads.Count > 1) // { // heads.Sort((a, b) => a.startFrame - b.startFrame); // } // nowPlayHeadsNumber = -1; //} //else //{ // headCollider.gameObject.SetActive(false); //} }