Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        trackedOrigin = transform.position;

        Attributes = GetComponent <Kataklizma.Gameplay.EntityAttributes>();
        Attributes.ValueChanged += Attributes_ValueChanged;
    }
Exemplo n.º 2
0
        // 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;
        }
Exemplo n.º 3
0
        // 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;
        }
Exemplo n.º 4
0
        // 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;
        }
Exemplo n.º 5
0
        /// <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;
        }