void Start() { //Debug.Log("PlayerController.Start()"); //item_equip_service = new EquipService(); input_controller = new PlayerInputControlAction(this); nmAgent = gameObject.GetComponent <NavMeshAgent>(); animator = gameObject.GetComponent <Animator>(); var default_character = new CharacterEntity(); animator.SetInteger("hp", default_character.hp); animator.radioBool("Idle"); state = State.Active; max_attack_speed = Mathf.RoundToInt(attack_speed * 0.8f); /* * Observable.Zip( * MessageBroker.Default.Receive<CreatedGameStageRank>(), * MessageBroker.Default.Receive<CreatedEquipBaseResouces>(), * MessageBroker.Default.Receive<InputInitialized>(), * MessageBroker.Default.Receive<EffectInitialized>(), * MessageBroker.Default.Receive<CreatedPlayerService>(), * Tuple.Create * ).Subscribe(x => { * initialized = true; * }); */ initialized = true; /* * MessageBroker.Default.Receive<CreatedPlayerService>().Subscribe(x => { * initialized = true; * }); */ /* * // Update * this.UpdateAsObservable().Subscribe(x => { * if (!character_control) { return; } * * animator.SetBool("DoDash", nmAgent.remainingDistance > animation_trigger_do_dash); * //if (this.in_action) { animator.SetBool("DoIdle", false); } * * if (!nmAgent.pathPending && !nmAgent.hasPath) { * nmAgent.ResetPath(); * } * * if (enemy_target != null) { * transform.LookAt(enemy_target.transform.position); * * if (Vector3.Distance(transform.position, enemy_target.transform.position) < enemy_target_distance) { * nmAgent.ResetPath(); * OnAttack(); * } * } * }); */ }
// Use this for initialization public void Start() { input_controller = new PlayerInputControlAction(this); this.terrain_chunk_size = TerrainService.terrain_config.chunk_size; //Log.write(StrOpe.i + "terrain_chunk_size: " + this.terrain_chunk_size); }