Esempio n. 1
0
    /**
     *	\brief Performs Entity specific initialization tasks (turn off renderer for nodraw faces, hide colliders, etc)
     */
    public void Awake()
    {
        pb = GetComponent <pb_Object>();
        if (pb == null)
        {
            // Debug.LogError("pb is null: " + gameObject.name);
            return;
        }

        if (pb.containsNodraw)
        {
            pb.HideNodraw();
        }

        switch (entityType)
        {
        case EntityType.Occluder:
            // Destroy(gameObject);
            break;

        case EntityType.Detail:
            break;

        case EntityType.Trigger:
                                #if !DEBUG
            GetComponent <MeshRenderer>().enabled = false;
            // Destroy(GetComponent<MeshRenderer>());
            // Destroy(this);
                                #endif
            break;

        case EntityType.Collider:
            // Destroy(GetComponent<pb_Object>());
                                #if !DEBUG
            GetComponent <MeshRenderer>().enabled = false;
            // Destroy(GetComponent<MeshRenderer>());
            // Destroy(this);
                                #endif
            break;
        }
    }
	/**
	 *	\brief Performs Entity specific initialization tasks (turn off renderer for nodraw faces, hide colliders, etc)
	 */
	public void Awake()
	{
		pb = GetComponent<pb_Object>();
		if(pb == null) 
		{
			// Debug.LogError("pb is null: " + gameObject.name);
			return;
		}

		if(pb.containsNodraw)
			pb.HideNodraw();

		switch(entityType)
		{
			case EntityType.Occluder:
				// Destroy(gameObject);
			break;

			case EntityType.Detail:
			break;

			case EntityType.Trigger:
				#if !DEBUG
				GetComponent<MeshRenderer>().enabled = false;
				// Destroy(GetComponent<MeshRenderer>());
				// Destroy(this);
				#endif
			break;

			case EntityType.Collider:
				// Destroy(GetComponent<pb_Object>());
				#if !DEBUG
				GetComponent<MeshRenderer>().enabled = false;
				// Destroy(GetComponent<MeshRenderer>());
				// Destroy(this);
				#endif
			break;
		}
	}