// Use this for initialization void Start() { trackedOrigin = transform.position; Attributes = GetComponent <Kataklizma.Gameplay.EntityAttributes>(); Attributes.ValueChanged += Attributes_ValueChanged; }
// Use this for initialization void Start() { Stats = GetComponent <EntityAttributes>(); if (Stats == null) { throw new System.ApplicationException(gameObject.name + " - CollapseOnDeath: Could not locate required EntityStats sibling."); } Stats.ValueChanged += OnStatsValueChanged; }
// Use this for initialization void Start() { IsFalling = false; Rb = GetComponent <Rigidbody>(); //if (Rb == null) throw new ApplicationException(gameObject.name + " - CollapseOnDeath: Could not locate required Rigidbody sibling."); Stats = GetComponent <EntityAttributes>(); if (Stats == null) { throw new ApplicationException(gameObject.name + " - CollapseOnDeath: Could not locate required EntityAttributes sibling."); } // NOTE: This warning no longer required as all maps are built on top of a Terrain piece - There may be empty blocks, but no holes. //if (gameObject.tag == "Building" && SpawnRubble == null && UnhideRubble == null) Debug.LogWarning(gameObject + " - SpawnOnDeath: Object tagged as building but no Rubble object provided, this may cause holes in world"); Stats.ValueChanged += OnStatsValueChanged; }
// Use this for initialization void Start() { Stats = GetComponent <EntityAttributes>(); if (Stats == null) { throw new System.ApplicationException(gameObject.name + " - LevelSystem: Could not locate required EntityStats sibling."); } if (Levels.Count < 1) { throw new System.ApplicationException(gameObject.name + " - LevelSystem: Levels cannot be empty."); } Stats[ValueType.CharacterLevel, ValueSubtype.Base] = 1; //Stats[ValueType.ExperienceThreshold, ValueSubtype.Base] = CurrentXpThreshold; DoLevelGained(); Stats.ValueChanged += OnPlayerStatsValueChanged; }
/// <summary> /// /// </summary> void Start() { Observer.Camera = GetComponentInChildren <Camera>(); if (Observer.Camera == null) { Debug.LogError(gameObject.name + " - PlayerController: Unable to locate required Camera child"); } Rb = GetComponent <Rigidbody>(); if (Rb == null) { Debug.LogError(gameObject.name + " - PlayerController::Start(): Unable to locate required Rigidbody sibling"); } CharacterAnimator = GetComponentInChildren <Animator>(); if (CharacterAnimator == null) { Debug.LogWarning(gameObject.name + " - PlayerController::Start(): Unable to locate Animation component in child"); } Attributes = GetComponent <EntityAttributes>(); if (CharacterAnimator == null) { Debug.LogError(gameObject.name + " - PlayerController::Start(): Unable to locate required EntityAttributes sibling"); } IsControllable = true; for (var i = 0; i < Abilities.Count; i++) { if (Abilities[i].Ability != null) { SetAbilitySlot(i, Abilities[i].Ability, true); } } Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }