void Start() { playerConfig = ConfigManager.main.GetConfig("PlayerConfig") as PlayerConfig; gameConfig = ConfigManager.main.GetConfig("GameConfig") as GameConfig; fireConfig = ConfigManager.main.GetConfig("FireConfig") as FireConfig; playerHandConfig = ConfigManager.main.GetConfig("PlayerHandConfig") as PlayerHandConfig; }
void Start() { playerConfig = ConfigManager.main.GetConfig("PlayerConfig") as PlayerConfig; gameConfig = ConfigManager.main.GetConfig("GameConfig") as GameConfig; fireConfig = ConfigManager.main.GetConfig("FireConfig") as FireConfig; playerHandConfig = ConfigManager.main.GetConfig("PlayerHandConfig") as PlayerHandConfig; InitializeCurve(); teleportArea = Instantiate(playerConfig.TeleportAreaPrefab); teleportArea.transform.SetParent(transform.parent); //teleportArea.color = playerConfig.TeleportAreaColorAllowed; }
void Start() { teleportPosition = GetComponentInChildren <TeleportPosition>(); fireConfig = ConfigManager.main.GetConfig("FireConfig") as FireConfig; gameConfig = ConfigManager.main.GetConfig("GameConfig") as GameConfig; debugRenderer = GetComponentInChildren <SpriteRenderer>(); Vector3 pos = debugRenderer.transform.position; pos.y = 0.1f; debugRenderer.transform.position = pos; FireSourceManager.main.AddFireSource(this); if (!isLit) { Extinguish(); } if (isLevelStart) { GameObject player = Instantiate(gameConfig.PlayerPrefab); player.GetComponentInChildren <TeleportCaster>().PreviousTeleportTarget = this; player.transform.position = TeleportPosition; } }
protected Player(string gameObjectName, string bulletPrefabName, float firePerFrame, float bulletMargin, int fireDamage) { this.moveConfig = new MoveConfig(); this.fireConfig = new FireConfig(); this.shieldConfig = new ShieldConfig(); this.gameObject = GameObject.Find(gameObjectName); this.gameObjectName = gameObjectName; this.fireConfig.bulletGameObject = (GameObject)Resources.Load("Scenes/Game/Prefabs/" + bulletPrefabName); this.fireConfig.firePerFrame = firePerFrame; this.fireConfig.margin = bulletMargin; this.fireConfig.damage = fireDamage; // バリアーを子オブジェクトとして生成する TODO プレハブを自機分ロードするのは無駄だが・・・ this.shieldConfig.shieldGameObject = (GameObject)Object.Instantiate((GameObject)Resources.Load("Scenes/Game/Prefabs/Player_shield"), this.gameObject.transform.position, Quaternion.identity); // 作成したオブジェクトを子として登録 this.shieldConfig.shieldGameObject.transform.parent = this.gameObject.transform; this.defaultScale = gameObject.transform.localScale; // 予測線 this.bulletLine = (GameObject)Object.Instantiate((GameObject)Resources.Load("Scenes/Game/Prefabs/ShotLine"), this.gameObject.transform.position, Quaternion.identity); this.bulletLine.transform.parent = this.gameObject.transform; this.bulletLine.transform.position = new Vector3(this.bulletLine.transform.position.x, this.bulletLine.transform.position.y + this.bulletLine.GetComponent <SpriteRenderer>().bounds.size.y / 2, 0); this.bulletLine.SetActive(false); }