//---------------------------------------------------------------------- // 初期化 //---------------------------------------------------------------------- // @Param none // @Return bool 成功か失敗 // @Date 2014/10/24 @Update 2014/10/24 @Author T.Kawashita //---------------------------------------------------------------------- protected bool Init() { m_pos = new Vector3(0.0f, 0.0f, 0.0f); m_speed = new Vector3(0.0f, 0.0f, 0.0f); m_angle = new Vector3(0.0f, 0.0f, 0.0f); m_status = CPlayerManager.ePLAYER_STATUS.eWAIT; m_oldStatus = CPlayerManager.ePLAYER_STATUS.eNONE; m_viewPointStatus = CPlayerManager.eVIEW_POINT_STATUS.ePLAYER; m_human = new CHuman(); m_playerData = new CPlayerData(); m_action = new CPlayerAction(); m_chargeFrame = 0; m_isRtPress = false; m_isLtPress = false; m_isBall = false; m_isGetBall = false; m_isOverRimit = false; m_isSE = false; m_gauge = this.transform.GetComponent <CPlayerGauge>(); m_playerSE = this.transform.GetComponent <CPlayerSE>(); return(true); }
public CPlayerData(CPlayerData value) { this.id = value.id; this.name = value.name; this.formation = value.formation; this.turnIndex = value.turnIndex; }
public static void SavePlayer(CPlayer player) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/player.fun"; FileStream stream = new FileStream(path, FileMode.Create); CPlayerData data = new CPlayerData(player); formatter.Serialize(stream, data); stream.Close(); }
private void Awake() { Init(); if (pd == null) { DontDestroyOnLoad(gameObject); pd = this; } else if (pd != null) { Destroy(gameObject); } }
public CPlayerData(CPlayerData value) { this.id = value.id; this.name = value.name; this.icon = value.icon; this.totalGold = value.totalGold; this.gold = value.gold; this.active = value.active; this.status = value.status; this.turnIndex = value.turnIndex; this.isOwner = value.isOwner; this.cardList = value.cardList; }
public void LoadPlayer() { CPlayerData data = CSaveSystem.LoadPlayer(); level = data.health; health = data.health; Vector3 position; position.x = data.position[0]; position.y = data.position[1]; position.z = data.position[2]; transform.position = position; }
public virtual void SetupItem(CPlayerData value, string name, Sprite icon, bool isOwner, UnityAction callback) { // INDEX this.currentData = value; // JOB NAME this.m_UIName.text = name; // JOB ICON this.m_Icon.sprite = icon; this.m_IsOwnerPlayer.SetActive(isOwner); // SUBMIT if (this.m_SubmitButton != null && callback != null) { this.m_SubmitButton.onClick.RemoveAllListeners(); this.m_SubmitButton.onClick.AddListener(callback); } }
public static CPlayerData LoadPlayer() { string path = Application.persistentDataPath + "/player.fun"; if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); CPlayerData data = formatter.Deserialize(stream) as CPlayerData; stream.Close(); return(data); } else { Debug.Log("Save file not found in " + path); return(null); } }
//---------------------------------------------------------------------- // コンストラクタ //---------------------------------------------------------------------- // @Param none // @Return none // @Date 2014/10/14 @Update 2014/10/14 @Author T.Kawashita //---------------------------------------------------------------------- void Start() { m_pos = new Vector3(); m_speed = new Vector3(); m_angle = new Vector3(); m_status = CPlayerManager.ePLAYER_STATUS.eNONE; m_oldStatus = CPlayerManager.ePLAYER_STATUS.eNONE; m_viewPointStatus = CPlayerManager.eVIEW_POINT_STATUS.ePLAYER; m_human = new CHuman(); m_playerData = new CPlayerData(); m_action = new CPlayerAction(); m_chargeFrame = 0; m_isRtPress = false; m_isLtPress = false; m_isBall = false; m_isGetBall = false; m_isOverRimit = false; m_isSE = false; }
public virtual void SetupItem(int index, CPlayerData value, string name, Sprite icon, bool isOwner, bool isTurn) { // INDEX this.m_Index = index; // DATA this.currentData = value; // JOB NAME this.m_UIName.text = name; // JOB ICON this.m_Icon.sprite = icon; // GOLD this.m_Gold.text = value.gold.ToString(); // ANIMATION this.m_IdleSprites = this.GetCharacterSprites((value.icon + 1).ToString(), 0, 4); this.m_DeathSprites = this.GetCharacterSprites((value.icon + 1).ToString(), 4, 2); this.m_AttackSprites = this.GetCharacterSprites((value.icon + 1).ToString(), 6, 1); // OWNER this.m_Owner.SetActive(isOwner); // TURN this.m_Turn.SetActive(isTurn); }
//---------------------------------------------------------------------- // プレイヤーのデータをセット //---------------------------------------------------------------------- // @Param none // @Return none // @Date 2014/11/20 @Update 2014/11/20 @Author T.Kawashita //---------------------------------------------------------------------- public static void SetPlayerData(CPlayerData _playerData, int _playerNo) { string[] work = new string[m_dataNum]; _playerData.Set(CUtility.ChangeArray(ref work, m_csvData, _playerNo)); }