public void UpdateReload() { // weapon hp update if( 0 == this.m_ReloadEnergy.max ) return ; // check offline if( true == this.IsOffline() ) return ; switch( this.m_WeaponReloadStatus ) { case WeaponReloadStatus.WeaponReloadStatus_Full : if( this.m_ReloadEnergy.now == this.m_ReloadEnergy.min ) this.m_WeaponReloadStatus = WeaponReloadStatus.WeaponReloadStatus_Empty ; else if( this.m_ReloadEnergy.now != this.m_ReloadEnergy.max ) this.m_WeaponReloadStatus = WeaponReloadStatus.WeaponReloadStatus_Reload ; break ; case WeaponReloadStatus.WeaponReloadStatus_Empty : if( this.m_ReloadEnergy.now == this.m_ReloadEnergy.max ) this.m_WeaponReloadStatus = WeaponReloadStatus.WeaponReloadStatus_Full ; else if( this.m_ReloadEnergy.now != this.m_ReloadEnergy.min ) this.m_WeaponReloadStatus = WeaponReloadStatus.WeaponReloadStatus_Reload ; break ; case WeaponReloadStatus.WeaponReloadStatus_Reload : if( this.m_ReloadEnergy.now == this.m_ReloadEnergy.max ) this.m_WeaponReloadStatus = WeaponReloadStatus.WeaponReloadStatus_Full ; else if( this.m_ReloadEnergy.now == this.m_ReloadEnergy.min ) this.m_WeaponReloadStatus = WeaponReloadStatus.WeaponReloadStatus_Empty ; break ; } // generation to reload float totalGenerationOfSec = this.TotalReloadGeneration() ; // Debug.Log( this.m_Name + "totalGenerationOfSec" + TotalReloadGeneration() ) ; this.m_ReloadEnergy.now += ( totalGenerationOfSec * Time.deltaTime ) ; }
public UnitComponentData( UnitComponentData _src ) { this.m_Name = _src.m_Name ; this.m_HP = new StandardParameter( _src.m_HP ) ; this.m_Energy = new StandardParameter( _src.m_Energy ) ; this.m_Generation = new StandardParameter( _src.m_Generation ) ; this.m_Effect = new StandardParameter( _src.m_Effect ) ; this.m_Status = _src.m_Status ; this.m_StatusDescription = new StatusDescription( _src.m_StatusDescription ) ; this.m_Effect_HP_Curve = new InterpolateTable( _src.m_Effect_HP_Curve ) ; this.m_ReloadEnergy = new StandardParameter( _src.m_ReloadEnergy ) ; this.m_ReloadGeneration = new StandardParameter( _src.m_ReloadGeneration ) ; this.m_WeaponReloadStatus = _src.m_WeaponReloadStatus ; this.m_ComponentParam = new ComponentParam( _src.m_ComponentParam ) ; this.m_WeaponParam = new WeaponParam( _src.m_WeaponParam ) ; }