示例#1
0
文件: Character.cs 项目: shnkrR/POG
    /// <summary>
    /// Create a character.
    /// </summary>
    /// <param name="stateMachine">State Machine instance</param>
    /// <param name="gameObject">World gameobject of this character</param>
    public Character(GameController gameController, GameObject gameObject)
    {
        mGameController = gameController;

        mAttributes = new CharacterInfoData.CharacterAttributes();
        mMeta       = new CharacterInfoData.CharacterMeta();

        _Speed = _Work = _Health = _Fertility = 0.5f;

        mSoulScore = 1;

        mSpawnPosition = GetRandomDestination();

        _GameObject = gameObject;
        _GameObject.transform.position = mSpawnPosition;

        SubscribeListeners();
    }
示例#2
0
文件: Character.cs 项目: shnkrR/POG
    /// <summary>
    /// Create a character.
    /// </summary>
    /// <param name="speed">Move speed</param>
    /// <param name="health">Max health</param>
    /// <param name="work">Work rate</param>
    /// <param name="fertility">Fertility rate</param>
    /// <param name="stateMachine">State Machine instance</param>
    /// <param name="gameObject">World gameobject of this character</param>
    public Character(GameController gameController, float speed, float health, float work, float fertility, int soulScore, GameObject gameObject)
    {
        mGameController = gameController;

        mAttributes = new CharacterInfoData.CharacterAttributes();
        mMeta       = new CharacterInfoData.CharacterMeta();

        _Speed     = speed;
        _Health    = health;
        _Work      = work;
        _Fertility = fertility;

        mSoulScore = soulScore;

        mSpawnPosition = GetRandomDestination();

        _GameObject = gameObject;
        _GameObject.transform.position = mSpawnPosition;

        SubscribeListeners();
    }