void Start() { playerData = GameObject.Find("PlayerData"); playerDataScript = playerData.GetComponent <PlayerData>(); audioSource = GetComponent <AudioSource>(); if (timeKeeper == null) { timeKeeper = GameObject.Find("TimeKeeper"); } timeKeeperScript = timeKeeper.GetComponent <TimeKeeper>(); if (gameDirector == null) { gameDirector = GameObject.Find("GameDirector"); } calcPointScript = gameDirector.GetComponent <CalcPoint>(); lanceData = playerDataScript.GetLance(); gameObject.GetComponent <SpriteRenderer>().sprite = lanceData.GetLanceImage(); moveSpeed = lanceData.GetMoveSpeed(); evaTextScript = evaluation.GetComponent <SetEvaluationText>(); _rb = GetComponent <Rigidbody2D>(); GetComponent <Collider2D>().enabled = false; startPos = gameObject.transform.position; goFlag = false; backFlag = false; fracJourney = 0f; }
/// <summary> /// 保存するデータを設定する。 /// </summary> /// <param name="data"></param> public void SetPlayerData(PlayerData data) { LanceStatusData _lsd = data.GetLance(); lanceName = _lsd.GetEquipmentName(); money = data.GetMoney(); FishDict = data.GetFish(); }
// Start is called before the first frame update void Start() { playerData = GameObject.Find("PlayerData"); playerDataScript = playerData.GetComponent <PlayerData>(); lanceData = playerDataScript.GetLance(); fishLimit = lanceData.GetFishMax(); _col2 = GetComponent <Collider2D>(); _rb = GetComponent <Rigidbody2D>(); audioSource = GetComponent <AudioSource>(); }
void Start() { playerData = GameObject.Find("PlayerData"); playerDataScript = playerData.GetComponent <PlayerData>(); lanceData = playerDataScript.GetLance(); Debug.Log(lanceData); moneyObj.GetComponent <Text>().text = "所持金:" + playerDataScript.GetMoney().ToString() + "円"; lanceImage.GetComponent <Image>().sprite = lanceData.GetLanceImage(); lanceName.GetComponent <Text>().text = lanceData.GetEquipmentName(); lanceData1.GetComponent <Text>().text = "はやさ:" + lanceData.GetMoveSpeed().ToString(); lanceData2.GetComponent <Text>().text = "一度に取れる魚の数:" + lanceData.GetFishMax().ToString(); lanceData3.GetComponent <Text>().text = "貫通力:" + lanceData.GetPenetration().ToString(); }
public void SetPanelActive() { GameObject _pData = GameObject.Find("PlayerData"); PlayerData _pdScript = _pData.GetComponent <PlayerData>(); LanceStatusData _ld = _pdScript.GetLance(); if (LanceData == _ld) { StartCoroutine(SetActiveCoroutine(isSameText)); return; } EquipmentDisplayDirector eddScript = equipmentSetPanel.GetComponent <EquipmentDisplayDirector>(); eddScript.SetText(LanceData); }
public void SetText(LanceStatusData data) { GameObject _pData = GameObject.Find("PlayerData"); PlayerData _pdScript = _pData.GetComponent <PlayerData>(); LanceStatusData _ld = _pdScript.GetLance(); clImage.GetComponent <Image>().sprite = _ld.GetLanceImage(); clFishMax.GetComponent <Text>().text = _ld.GetFishMax().ToString(); clSpeed.GetComponent <Text>().text = _ld.GetMoveSpeed().ToString(); clPenetration.GetComponent <Text>().text = _ld.GetPenetration().ToString(); nlImage.GetComponent <Image>().sprite = data.GetLanceImage(); nlFishMax.GetComponent <Text>().text = data.GetFishMax().ToString(); nlSpeed.GetComponent <Text>().text = data.GetMoveSpeed().ToString(); nlPenetration.GetComponent <Text>().text = data.GetPenetration().ToString(); gameObject.SetActive(true); }
//================================================ //PlayerDataUtility //================================================ private void Start() { //保存しておいたデータを取得する PlayerDataInstance _pInstance = PlayerDataInstance.Instance; dataList = gameObject.GetComponent <DataList>(); string lanceName = _pInstance.GetLanceName(); //初期状態だとlanceNameが""なので、初期装備を設定 //lanceNameが存在するなら該当する装備を取得 if (lanceName == "") { lance = dataList.GetLance("ボロのモリ"); lance.IsBought = true; } else { lance = dataList.GetLance(lanceName); } money = _pInstance.GetMoney(); fishes = _pInstance.GetFish(); }
void Start() { playerData = GameObject.Find("PlayerData"); playerDataScript = playerData.GetComponent <PlayerData>(); dataListScript = playerData.GetComponent <DataList>(); lanceData = playerDataScript.GetLance(); caughtFish = new CaughtFish[fishDatas.Count]; HaveFishType fishTypeValue; switch (lanceData.GetLanceType()) { case LanceType.TYPE_LANCE: fishTypeValue = HaveFishType.TYPE_KILLED; break; case LanceType.TYPE_HAND: case LanceType.TYPE_NET: fishTypeValue = HaveFishType.TYPE_PICKED; break; default: Debug.Log("LanceType is TYPE_NULL or other error"); fishTypeValue = HaveFishType.TYPE_NULL; break; } for (int i = 0; i < fishDatas.Count; i++) { caughtFish[i].SetHaveFishType(fishTypeValue); caughtFish[i].SetFishType(fishDatas[i].GetFishType()); caughtFish[i].SetFishName(fishDatas[i].GetFishName()); } Debug.Log(caughtFish); }
/// <summary> /// 装備品を設定する。 /// </summary> /// <param name="lanceData"></param> public void SetLance(LanceStatusData lanceData) { lance = lanceData; }
public void SetLanceData(LanceStatusData lance) { lanceStatusData = lance; }