Esempio n. 1
0
        public void AssembleUnit(UnitAsset asset, bool gotoIdling, bool gotoAlive)
        {
            //has been spawned by asset
            if (!asset)
            {
                Debug.Log("no asset supplied to builder");
            }
            m_state    = UnitStateType.none;
            m_asset    = asset;
            m_isPlayer = m_asset.IsPlayer();
            m_faction  = m_asset.Faction();

            GetComponents();
            AssembleSubComponents();

            SetNewUnitState(UnitStateType.assembled);

            if (gotoIdling || gotoAlive)
            {
                SetNewUnitState(UnitStateType.idling);
            }
            if (gotoAlive)
            {
                SetNewUnitState(UnitStateType.alive);
            }
        }
Esempio n. 2
0
        public void AssembleHealth(UnitStateType state, UnitAsset asset, UnitBuilder builder, UnitAnimation animation)
        {
            m_asset     = asset;
            m_state     = state;
            m_builder   = builder;
            m_animation = animation;

            m_isPlayer = m_asset.IsPlayer();
            m_pool     = m_asset.ObjectPoolAsset();
            m_faction  = m_asset.Faction();

            m_playerHealthChangeEvent = m_asset.UnitHealthChangeEvent();
            m_playerDeathEvent        = m_asset.UnitDeathEvent();
        }