public void Awake() { Stage.Load(GameSetting.StageName); GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); Player1 = players[0].GetComponent<PlayerController>(); Player1.Initialize(GameSetting.Player1, GameSetting.SlotCount); }
void Awake() { GameObject g = Instantiate(Resources.Load<GameObject>("Player")) as GameObject; g.name = "Player"; player = g.GetComponent<PlayerController>(); player.Initialize( GameStatus.StageInformation.StartPosition, GameStatus.StageInformation.StartRotation, GameStatus.PlayerSettings.HPLevel, GameStatus.PlayerSettings.SpeedLevel, GameStatus.EquipedPartsList ); }
public void Awake() { Stage.Load(GameSetting.StageName); GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); Player1 = players[0].GetComponent<PlayerController>(); Player1.Initialize(GameSetting.Player1, GameSetting.SlotCount); Player2 = players[1].GetComponent<PlayerController>(); Player2.Initialize(GameSetting.Player2, GameSetting.SlotCount); for(var i = 0;i < players.Length;i++) { Players[i] = players[i].GetComponent<PlayerController>(); } }
public virtual void Initialize(GameObject player, PartsSetting setting) { Parent = player; Player = Parent.GetComponent<PlayerController>(); SetLevel(setting.Level); }
/// <summary> /// パーツの初期化 /// Initializeしたらこれすればいいだけにしたい /// </summary> /// <param name="player"></param> /// <param name="partslevel"></param> public virtual void Initialize(GameObject player, int partslevel) { Parent = player; Player = Parent.GetComponent<PlayerController>(); SetLevel(partslevel); }
void Start() { if (player == null) player = GameObject.Find("/Player").GetComponent<PlayerController>(); }
public void SetPlayer(PlayerController player) { Player = player; }
public void Start() { panel = Instantiate(Resources.Load<GameObject>("Prefabs/UIPrefabs/ButtlePanel")).GetComponent<RectTransform>(); panel.SetParent(GameObject.Find("/Canvas").transform); panel.sizeDelta = new Vector2(); panel.SetSiblingIndex(0); panel.position = new Vector3(panel.rect.width / 2, panel.rect.height / 2, 0); player = GameObject.Find("/Player").GetComponent<PlayerController>(); maxHP = player.MaxHP; hpbar = panel.FindChild("HPPanel/HPBar").GetComponent<Slider>(); hptext = panel.FindChild("HPPanel/HPText").GetComponent<Text>(); hpbar.maxValue = maxHP; enemyPoint = Resources.Load<GameObject>("Prefabs/UIPrefabs/EnemyPoint"); radarPanel = panel.FindChild("RadarPanel").gameObject; playerPoint = panel.FindChild("RadarPanel/PlayerPoint").gameObject; prtf = playerPoint.GetComponent<RectTransform>(); ptf = player.transform; rrtf = radarPanel.GetComponent<RectTransform>(); marker = panel.FindChild("MarkerPanel").GetComponent<MarkerScript>(); maincamera = GameObject.Find("/Player/Main Camera").GetComponent<Camera>(); remainingEnemyPanel = panel.FindChild("RemainingEnemyPanel").GetComponent<RectTransform>(); remainingEnemyNumText = remainingEnemyPanel.FindChild("Text").GetComponent<Text>(); remainingEnemyPanel.localScale = Vector3.zero; timeLimitPanel = panel.FindChild("TimeLimitPanel").GetComponent<RectTransform>(); timeLimitText = timeLimitPanel.FindChild("Text").GetComponent<Text>(); timeLimitPanel.localScale = Vector3.zero; }
public override void Start() { Player = GameObject.Find("/Player").GetComponent<PlayerController>(); }