示例#1
0
 // Use this for initialization
 void Start()
 {
     inGameLogs             = FindObjectOfType(typeof(InGameLog)) as InGameLog;
     style                  = new GUIStyle();
     style.alignment        = TextAnchor.MiddleCenter;
     style.normal.textColor = Color.white;
     style.wordWrap         = true;
 }
示例#2
0
	// Use this for initialization
	void Start () {
		inGameLogs = FindObjectOfType( typeof(InGameLog)) as InGameLog ;
		Debug.Log("test long text sdf asdfg asdfg sdfgsdfg sdfg sfg sdfgsdfg sdfg sdf gsdfg sfdg sf gsdfg sdfg asdfg asdf asdf asdf asdf adsf ");
		
		style = new GUIStyle();
		style.alignment = TextAnchor.MiddleCenter ;
		style.normal.textColor = Color.white ;
		style.wordWrap = true ;
		
		for( int i = 0 ; i < 10 ; i ++ )
		{
			Debug.Log("Test Collapsed log");
			Debug.LogWarning("Test Collapsed Warning");
			Debug.LogError("Test Collapsed Error");
		}
	}
示例#3
0
    // Use this for initialization
    void Start()
    {
        inGameLogs = FindObjectOfType(typeof(InGameLog)) as InGameLog;
        Debug.Log("test long text sdf asdfg asdfg sdfgsdfg sdfg sfg sdfgsdfg sdfg sdf gsdfg sfdg sf gsdfg sdfg asdfg asdf asdf asdf asdf adsf ");

        style                  = new GUIStyle();
        style.alignment        = TextAnchor.MiddleCenter;
        style.normal.textColor = Color.white;
        style.wordWrap         = true;

        for (int i = 0; i < 10; i++)
        {
            Debug.Log("Test Collapsed log");
            Debug.LogWarning("Test Collapsed Warning");
            Debug.Log("Test Collapsed Error");
        }
    }
示例#4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Debug.Log(name + " hited " + collision.name);
     InGameLog.LogFunc(name + " hited " + collision.name);
     if (collision.CompareTag("EnemyBullet"))
     {
         Bullet bullet = collision.GetComponent <Bullet>();
         if (HealthPoint <= 0)
         {
             Instantiate(DeadExplosion, transform.position, Quaternion.identity);
             Destroy(gameObject);
             return;
         }
         Instantiate(HitedExplosion, collision.transform.position, Quaternion.identity);
         Destroy(collision.gameObject);
         HealthPoint -= bullet.BulletDamage;
     }
 }
示例#5
0
    public void ConsolCommand(string command)
    {
        switch (command)
        {
        case "spawn player":
            Instantiate(player, new Vector3(-6f, 0f, 0f), Quaternion.identity);
            InGameLog.LogFunc("Execute : " + command);
            break;

        case "spawn enemy":
            Instantiate(enemey, new Vector3(6f, 0f, 0f), Quaternion.identity);
            InGameLog.LogFunc("Execute : " + command);
            break;

        default:
            InGameLog.LogFunc("It's not correct Command");
            break;
        }
    }
示例#6
0
文件: InGameLog.cs 项目: unagi11/FPS
 // Use this for initialization
 void Start()
 {
     inGameLog = this;
     Log       = GetComponent <Text>();
 }