/// <summary> /// 初期化 /// 継承先では呼ばないこと /// </summary> /// <remarks> /// 外部呼び出しのみ /// </remarks> /// <param name="teamType">AIが動かすごとができるチームタイプ</param> /// <param name="battleSystem">保持するバトルロジッククラス</param> public void Initialize(Define.Battle.TEAM_TYPE teamType, BattleSystem battleSystem) { _teamType = teamType; _enemyTeam = GetEnemyTeamType(_teamType).Value; _actorManager = ApplicationManager.Instance.ActorManager; _battleSystem = battleSystem; _battleSystem.ItemManager.ItenSpawnCallBackDelegate += ItemSpawnCallback; }
//--------------------------------------------------- // Initialize //--------------------------------------------------- public void Initialize(Define.Battle.TEAM_TYPE teamType, Vector3 pos, Vector3 range, int attackFrame, float attackPower) { _teamType = teamType; _boxCollider.size = range; _actorManager = ApplicationManager.Instance.ActorManager; _attackPower = attackPower; _endFrameCount = attackFrame; gameObject.transform.position = pos; _isInitilaize = true; }
//--------------------------------------------------- // InitializeCoroutin //--------------------------------------------------- IEnumerator InitializeCoroutine() { if (_gameSceneManager == null) { _gameSceneManager = gameObject.AddComponent <GameSceneManager>(); _gameSceneManager.Initialize(); } if (_actorManager == null) { _actorManager = new ActorManager(); } if (_master == null) { _master = gameObject.AddComponent <Master>(); while (_master.IsInitialize == false) { yield return(null); } } if (_cameraManager == null) { _cameraManager = gameObject.AddComponent <CameraManager>(); } if (_effectManager == null) { _effectManager = gameObject.AddComponent <EffectManager>(); } if (_ncmbSetting == null) { yield return(Common.LoadAsync("Prefabs/Settings/NCMBSetting", (obj) => { _ncmbSetting = GameObject.Instantiate(obj as GameObject) as GameObject; })); } if (Master.CheckDataAll() == false) { GameSceneManager.ChangeScene(Define.Scenes.DANGER); } QualitySettings.SetQualityLevel(0); _isInitialize = true; yield return(null); }
//--------------------------------------------------- // AttackHitCallBack //--------------------------------------------------- public void AttackHitCallBack(Actor hitActor, float attackPower) { ActorManager actorManager = ApplicationManager.Instance.ActorManager; Character hit = hitActor.GetComponent <Character>(); if (hit.CharacterModel.Invincible == false && hit.CharacterModel.Hp > 0) { if (hit.CharacterModel.Hp - attackPower < 0) { attackPower = hit.CharacterModel.Hp; } hit.CharacterModel.Hp -= attackPower; } }
//--------------------------------------------------- // Release //--------------------------------------------------- public void Release() { if (_gameSceneManager != null) { _gameSceneManager.Release(); _gameSceneManager = null; } if (_actorManager != null) { _actorManager.Release(); _actorManager = null; } if (_master != null) { _master = null; } if (_effectManager != null) { _effectManager = null; } }
//--------------------------------------------------- // Release //--------------------------------------------------- override protected void Release() { _actorManager = null; }