Example #1
0
    private void UpdateUnitPosition()
    {
        Dictionary <string, GameObject> .Enumerator iMap =
            m_Units.GetEnumerator();

        while (iMap.MoveNext())
        {
            GameObject obj = iMap.Current.Value;
            if (null != obj)
            {
                GameUnitData01 unitData = obj.GetComponent <GameUnitData01>();
                if (null != unitData)
                {
                    Vector3 velocity = unitData.m_Velocity;

                    if (0 != velocity.magnitude &&
                        false == m_PauseThisFrame)
                    {
                        obj.transform.Translate(velocity, Space.World);
                        obj.transform.rotation = Quaternion.LookRotation(velocity);
                    }

                    unitData.m_Velocity = Vector3.zero;
                }
            }
        }
    }
	private void InitializeGameUnitDataPtr()
	{
		m_UnitDataPtr = this.gameObject.GetComponent<GameUnitData01>() ;
		if( null == m_UnitDataPtr )
		{
			Debug.LogError( "AllienMovement01::InitializeGameUnitDataPtr() ,null == m_UnitDataPtr" ) ;
		}
		else
		{
			Debug.Log( "AllienMovement01::InitializeGameUnitDataPtr() end." ) ;
		}
	}
Example #3
0
    private void InitializeUnitDataPtr()
    {
        m_UnitData = this.GetComponent <GameUnitData01>();

        if (null == m_UnitData)
        {
            Debug.LogError("FollowTheMainCharacter02:InitializeUnitDataPtr() null == m_UnitData");
        }
        else
        {
            Debug.Log("FollowTheMainCharacter02:InitializeUnitDataPtr() end.");
        }
    }
	private void InitializeUnitDataPtr()
	{
		
		m_UnitData = this.GetComponent<GameUnitData01>() ;
		
		if( null == m_UnitData )
		{
			Debug.LogError( "FollowTheMainCharacter02:InitializeUnitDataPtr() null == m_UnitData" ) ;
		}
		else
		{
			Debug.Log( "FollowTheMainCharacter02:InitializeUnitDataPtr() end." ) ;
		}
	}		
Example #5
0
 // Use this for initialization
 void Start()
 {
     m_StartTime    = Time.timeSinceLevelLoad;
     m_LanchEndTime = m_StartTime + m_LanchSec;
     m_UnitData     = this.gameObject.GetComponent <GameUnitData01>();
 }
	// Use this for initialization
	void Start () 
	{
		m_StartTime = Time.timeSinceLevelLoad ;
		m_LanchEndTime = m_StartTime + m_LanchSec ;
		m_UnitData = this.gameObject.GetComponent<GameUnitData01>() ;
	}