コード例 #1
0
    // Use this for initialization
    void Start()
    {
        _screenHSize = Screen.height;
        _screenWsize = Screen.width;
        GUITexture GameSetting = FindObjectOfType(typeof(GUITexture)) as GUITexture;

        if (GameSetting.name == "Main Camera")
        {
            GameSetting.transform.position   = Vector3.zero;
            GameSetting.transform.localScale = Vector3.zero;
            GameSetting.pixelInset           = new Rect(0, 0, _screenWsize, _screenHSize);
        }

        GameObject player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity) as GameObject;

        player.name = "player";

        _playerInformation = new PlayerInformation();
        _playerInformation.Awake();

        for (int i = 0; i < Enum.GetValues(typeof(AttributeName)).Length; i++)
        {
            _playerInformation.GetPrimaryAttribute(i).BaseValue = STARTING_VALUE;
        }

        _playerInformation.StatUpdate();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        storeInfo = GameObject.FindGameObjectWithTag("Constant");

        _screenHSize = Screen.height;
        _screenWsize = Screen.width;
        _center.Set(_screenWsize / 2, _screenHSize / 2, 0);
        #region
        /// <summary>
        /// NewGame.cs
        ///
        /// Title: Hack & Slash RPG - A Unity3D Game Engine Tutorial | BurgZerg Arcade. [Online].;
        /// Author: Laliberte P.
        /// Date: 2013 October 24.
        /// Available from: http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial
        /// </summary>
        GUITexture MainCamera = FindObjectOfType(typeof(GUITexture)) as GUITexture;
        if (MainCamera.name == "GameSettings")
        {
            MainCamera.transform.position   = Vector3.zero;
            MainCamera.transform.localScale = Vector3.zero;
            MainCamera.pixelInset           = new Rect(0, 0, _screenWsize, _screenHSize);
        }

        _mainCharacter = new PlayerInformation();
        _mainCharacter.Awake();
        #endregion
    }
コード例 #3
0
    // Use this for initialization
    public void Start()
    {
        info = new PlayerInformation();
        info.Awake();
        chars           = new CharacterGen();
        enemyTypeNumber = 0;
        playerNumber    = 1;
        for (int i = 0; i < Enum.GetValues(typeof(AttributeName)).Length; i++)
        {
            info.GetPrimaryAttribute(i).BaseValue = chars.STARTING_VALUE;
        }
        characterName           = String.Empty;
        itemAmount              = 0;
        _primaryAttribute       = new string[info._primaryAttribute.Length];
        _primaryAttributeValues = new int[info._primaryAttribute.Length];
        _vital            = new string[info._vital.Length];
        _vitalValue       = new int[info._vital.Length];
        _mana             = new string[info._mana.Length];
        _manaValue        = new int[info._mana.Length];
        _attack           = new string[info._attack.Length];
        _attackValue      = new int[info._attack.Length];
        _defence          = new string[info._defence.Length];
        _defenceValue     = new int[info._defence.Length];
        moneyTotal        = 0;
        money             = new MoneySystem();
        itemsNameArray    = new ArrayList();
        itemsContentArray = new ArrayList();
        experience        = 100;

        nextLevelvalue = experience * 1.2f;
        nextLevel      = (int)(experience * 1.2f);
        level          = 1;
        initiliseConstantVariables();

        playerPos = GameObject.FindGameObjectWithTag("Player");
        if (playerPos != null)
        {
            positionOnScreen = playerPos.transform.position;
        }


        if (PlayerPrefs.GetString("Player Name") != "")
        {
            LoadData();
        }
    }
コード例 #4
0
    // Use this for initialization
    public void Start()
    {
        info = new PlayerInformation();
        info.Awake();
        chars = new CharacterGen();
        enemyTypeNumber =0;
        playerNumber =1;
        for (int i = 0; i < Enum.GetValues(typeof(AttributeName)).Length; i++) {
            info.GetPrimaryAttribute (i).BaseValue = chars.STARTING_VALUE;
        }
        characterName = String.Empty;
        itemAmount = 0;
        _primaryAttribute = new string[info._primaryAttribute.Length];
        _primaryAttributeValues=new int[info._primaryAttribute.Length];
        _vital = new string[info._vital.Length];
        _vitalValue=new int[info._vital.Length];
        _mana = new string[info._mana.Length];
        _manaValue=new int[info._mana.Length];
        _attack = new string[info._attack.Length];
        _attackValue = new int[info._attack.Length];
        _defence = new string[info._defence.Length];
        _defenceValue = new int[info._defence.Length];
        moneyTotal=0;
        money = new MoneySystem();
        itemsNameArray = new ArrayList();
        itemsContentArray = new ArrayList();
        experience =100;

        nextLevelvalue = experience*1.2f;
        nextLevel = (int)(experience*1.2f);
        level =1;
        initiliseConstantVariables();

        playerPos = GameObject.FindGameObjectWithTag("Player");
        if(playerPos!=null)
            positionOnScreen= playerPos.transform.position;

        if(PlayerPrefs.GetString ("Player Name")!= ""){
            LoadData();
        }
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        _screenHSize = Screen.height;
        _screenWsize = Screen.width;
        GUITexture GameSetting = FindObjectOfType (typeof(GUITexture)) as GUITexture;
        if (GameSetting.name == "Main Camera") {
            GameSetting.transform.position = Vector3.zero;
            GameSetting.transform.localScale = Vector3.zero;
            GameSetting.pixelInset = new Rect (0,0, _screenWsize,_screenHSize);
        }

        GameObject player = Instantiate(playerPrefab,Vector3.zero, Quaternion.identity) as GameObject;

        player.name = "player";

        _playerInformation = new PlayerInformation();
        _playerInformation.Awake();

        for (int i = 0; i < Enum.GetValues(typeof(AttributeName)).Length; i++) {
            _playerInformation.GetPrimaryAttribute (i).BaseValue = STARTING_VALUE;
        }

        _playerInformation.StatUpdate();
    }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        storeInfo = GameObject.FindGameObjectWithTag ("Constant");

        _screenHSize = Screen.height;
        _screenWsize = Screen.width;
        _center.Set ( _screenWsize/ 2, _screenHSize / 2, 0);
        #region
        /// <summary>
        /// NewGame.cs
        ///
        /// Title: Hack & Slash RPG - A Unity3D Game Engine Tutorial | BurgZerg Arcade. [Online].;
        /// Author: Laliberte P.
        /// Date: 2013 October 24.
        /// Available from: http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial
        /// </summary>
        GUITexture MainCamera = FindObjectOfType (typeof(GUITexture)) as GUITexture;
        if (MainCamera.name == "GameSettings") {
            MainCamera.transform.position = Vector3.zero;
            MainCamera.transform.localScale = Vector3.zero;
            MainCamera.pixelInset = new Rect (0,0, _screenWsize,_screenHSize);
        }

        _mainCharacter = new PlayerInformation ();
        _mainCharacter.Awake ();
        #endregion
    }