Created
April 20, 2018 20:46
-
-
Save listopad/332e6fc53881fddbe79b0b981b71b568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Character : MonoBehaviour | |
{ | |
// Базовое количество жизней | |
private const int baseHealth = 100; | |
// Количество жизней персонажа в начале делаем базовым | |
private static int health = baseHealth; | |
private static class Skills | |
{ | |
public static int agility = 10; | |
private static int strength = 10; | |
public static int Strength | |
{ | |
get { return strength; } | |
/* | |
* При изменении силы, меняем количество жизней персонажа | |
* добавляя к нему количество силы (ну или домножать можно) | |
*/ | |
set | |
{ | |
strength = value; | |
health = baseHealth + strength; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment