void Start()
    {
        rb      = GetComponent <Rigidbody>();
        health  = GetComponent <HealthScript>();
        stamina = GetComponent <StaminaScript>();

        health.SetHealth(200, 200);
        stamina.SetStamina(100, 100);
        stamina.SetRegen(50 * Time.deltaTime);
    }
Exemple #2
0
 public override void basicAttack(GameObject target)
 {
     if (target.GetComponent <Action>().amBard)
     {
         HealthScript targetHealth = target.GetComponent <HealthScript>();
         targetHealth.takeDamage(basicAttackDmg);
         Debug.Log(this.name + " Basic Attack " + target.name);
     }
     else
     {
         StaminaScript targetHealth = target.GetComponent <StaminaScript>();
         targetHealth.useStamina(basicAttackDmg);
         Debug.Log(this.name + " Basic Attack " + target.name);
     }
 }
 //Initialization
 private void Start()
 {
     CharacterSystem = GetComponent <CharacterController>();
     StaminaSystem   = GetComponent <StaminaScript>();
 }
Exemple #4
0
 // Start is called before the first frame update
 void Start()
 {
     affection    = GameObject.Find("Frodo").GetComponent <PlayerAffection>();
     Food         = startFood;
     frodoStamina = GameObject.Find("Frodo").GetComponent <StaminaScript>();
 }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        Data = gameObject.GetComponent<PlayerData>();

        if (OnAnim)
        {
            anim = GetComponent<Animator>();
            rig = GetComponent<Rigidbody2D>();
        }
        if (isMe)
        {
            Move = gameObject.GetComponent<CharacterMove>();
            Stamina = gameObject.GetComponent<StaminaScript>();

            // パラメータを1~5に調整
            Speed = MaxSetting(Speed);
            Boost = MaxSetting(Boost);
            Accel = MaxSetting(Accel);

            // 最高速度を変更
            SetSpeed(25f + 5f * Speed);
            // 加速までの時間を変更
            SetAccel(30 - 2 * Accel);
            // スタミナの最大値を変更
            Stamina.ChangeMax(500 + 100 * Boost);
        }
        // 三角アイコンの色を変更
        IconColor(GetPlayerNumber());
    }
 protected virtual void Start()
 {
     stamina = GetComponent <StaminaScript>();
 }
 // Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     characterAnimator = GetComponentInChildren <CharacterAnimator>();
     staminaScript     = GetComponent <StaminaScript>();
 }